ErrorDocument 403 "<!DOCTYPE html><html><head></head><body></body></html>"
RewriteEngine on
RewriteCond %{http_Referer} !^https?://(www\.)?(site\.ru|(yandex|google)\.\w+)/
RewriteCond %{http:From} !(googlebot|yandex)
RewriteRule ^ - [R=403,L]
map $args $_at {
default "@";
"" "";
}
server {
location ~ ^(.+)\.html$ {
return 301 $1$is_args$args;
}
location / {
try_files $uri $uri$_at$args.html $uri/ /index.php?$args;
}
RewriteRule ^/api/v1/(\w+)$ /web/api/v1/$1.php [L,NC]
Первому RewriteRule передается путь от того места, где находится .htaccess, до запрошенного файла. Эта строка никогда не начинается со "/".
^/api
на ^api
RewriteCond %{QUERY_STRING} (?:^|&)diaryId=(\d+)
RewriteRule ^showDiary\.do$ http://site.com/diary/%1? [R=301,L]
RewriteCond %{HTTP_HOST} ^site\.com$
RewriteRule ^ru/(.*) https://ru.site.com/$1 [R=301,L]
RewriteCond %{QUERY_STRING} ^(s=[^&]*)&
RewriteRule (.*) /$1?%1 [R=301,L,NE]
RewriteCond %{QUERY_STRING} ^(?|(s=[^&]*)&|.*?&(s=[^&]*))
RewriteRule (.*) /$1?%1 [R=301,L,NE]
RewriteRule ^(.*)$ https://svai-a.ru/$1 [L,R=301]
RewriteCond &%{QUERY_STRING} ^(.*?)&page=([^&]+)(.*)
RewriteCond /$1/page-%2?%1%3 ^(.+?\?)&*(.*)
RewriteRule ^(news)$ %1%2 [R=301,L]
RewriteCond %{QUERY_STRING} ^()page=([^&]+)&*(.*) [OR]
RewriteCond %{QUERY_STRING} ^(.*?)&page=([^&]+)(.*)
RewriteRule ^(news)$ /$1/page-%2?%1%3 [R=301,L]
&
в конце строки ?utm=ex&
, то сойдёт и так.RewriteCond %{QUERY_STRING} ^(|.*?&)page=([^&]+)&*(.*)
RewriteRule ^(news)$ /$1/page-%2?%1%3 [R=301,L]
PHP Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /home/a/alechas/.../public_html/UnitPay.php on line 208
array_map(function ($item) {
function ($item) {
добавили начиная с PHP 5.3RewriteRule ^sitemap.xml$ sitemap.xml [L]
RewriteRule ^admin/(.*)$ admin/$1 [L]
RewriteRule ^uploads/([^/]+)/(.*)$ getphoto.php?folder=$1&src=$2 [L]
RewriteRule (js|css|fonts)/(.*) $1/$2 [L]
RewriteRule img/(.*)$ getphoto.php?src=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/.]+)$ /$1/ [L,R=301]
RewriteRule ^(.*)/$ index.php?src=$1 [QSA,L]
RewriteRule ^test1/fruits/$ https://domain2.ru/test2/fruits-test/ [R=301,L]
RewriteRule ^test1-test/$ https://domain2.ru/test2-test/ [R=301,L]
RewriteRule ^(.*)$ /index.php/$1 [L,QSA]
срабатывает раньше чем RewriteRule ^(.*)$ https://newsite.ru/$1 [R=301,L]
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.|)oldsite\.ru$ [NC]
RewriteRule ^(.*)$ https://newsite.ru/$1 [R=301,L]
RewriteCond $1 !^(index\.php|uploads|robots\.txt|favicon\.ico|sitemap\.xml)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L,QSA]
RewriteRule ^katalog/(?!product/)[^/]+/(?!brand-)([^/]+)/$ https://site.ru/katalog/product/$1/ [R=301,L]
RewriteCond $2 !=product
RewriteCond $3 !^brand-
RewriteRule ^(katalog)/([^/]+)/([^/]+)/$ https://site.ru/$1/product/$3/ [R=301,L]
<VirtualHost *:80>
ServerName mysite.net.ua
ServerAlias www.mysite.net.ua
DocumentRoot /var/www/mysite.net.ua/www
</VirtualHost>
<VirtualHost *:80>
ServerName mysite.net.ua
ServerAlias *.mysite.net.ua
UseCanonicalName Off
VirtualDocumentRoot /var/www/mysite.net.ua/%-4
</VirtualHost>