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
rewrite ^/MeDia/backups $uri_lowercase redirect;
rewrite ^/(?=(?i)media/backups)(?=.*?[A-Z]) $uri_lowercase redirect;
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]
preg_replace('~<(a|h1)\b.*?</\1>(*SKIP)(*F)|(222)~si', '<a href="#link">\\2</a>', $str);
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]
location ~ \.(css|jpe?g|png)$ {
try_files $uri @b;
}
location @b {
proxy_pass https://1.1.1.1;
proxy_set_header Host site.ru;
proxy_ssl_name site.ru;
}