RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
[R=301,L]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteRule ^(.*)index\.(php|html|htm)$ https://%{HTTP_HOST}%$1 [R=301,L]
%$1
/
или /$1
RewriteRule ^(.*)index\.(php|html|htm)$ https://%{HTTP_HOST}/ [R=301,L]
RewriteEngine on
RewriteRule ^tex(.*)$ /cgi-bin/mathtex.cgi?$1 [L,QSA]
RewriteCond %{REQUEST_URI} !^/cgi-bin/mathtex\.cgi
RewriteRule ^(.*)$ public/$1 [L]
Необходимо иметь в виду, что при использовании индексного файла делается внутреннее перенаправление и запрос может быть обработан уже в другом location’е.
index index.html;
нужен try_files.location = / {
try_files /index.html =404;
}
location / {
proxy_pass ...;
}
location = / {
rewrite ^ /index.html break;
}
location / {
proxy_pass ...;
}
/
т.е. всегда остается просто info/.^info/?$
убрать /?
то правило будет срабатывать только для site.ru/infoRewriteCond %{THE_REQUEST} ^[^?]+//
RewriteRule .* /$0 [R=301,L]
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://95.216.144.51:8080;
location @fallback {
proxy_pass http://95.216.144.51:8080;
}
location ~ ^/id/(.+) {
return 301 /?id=$1;
}
rewrite ^/id/(.+) /?id=$1 permanent;
rewrite ^/id/(.+) /?id=$1 last;
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^https?://ireenamyha\.myjino\.ru/videovier\.php
RewriteRule \.mp4$ - [F]
AllowOverride All
в настройках VirtualHost.RewriteRule ^(.*)$ /index.php?action=$1 [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?action=$1 [QSA,L]
RewriteCond %{HTTP_HOST} ^(?:www\.)?domain\.ru$ [NC]
RewriteRule ^(spb|msk|rostov)/(.*) http://$1.domain.ru/$2 [R=301,L]
RewriteCond %{HTTP_HOST} ^(?:www\.)?domain\.ru$ [NC]
RewriteCond %{REQUEST_URI} ^/(msk)/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/(spb)/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/(rostov)/(.*)$
RewriteRule ^ http://%1.domain.ru/%2 [R=301,L]
нужно https://site/old переадресовать на https://site/new
RewriteRule ^old$ https://site/new? [R=301,L]