DirectorySlash off
RewriteEngine On
RewriteRule ^(|.+/)index\.html$ https://site.ru/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ https://site.ru/$1 [R=301,L]
RewriteCond %{HTTP:X-Forwarded-Protocol} !=https [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
301 Перемещено навсегда http://сайт.ру/папка/ 302 Редирект https://сайт.ру/папка/
http://site.ru/catalog.php?id=1 -> http://site.ru/id=1
http://site.ru/catalog.php?id=27 -> http://site.ru/ciatim-221
http://site.ru/catalog.php?id=50 -> http://site.ru/page1
http://site.ru/catalog.php?id=72 -> http://site.ru/page2
RewriteCond %{QUERY_STRING} (^|&)id=(\d+)($|&)
RewriteCond "%2 \
1 => /id=1 \
27 => /ciatim-221 \
50 => /page1 \
72 => /page2 \
" "^(\S+) .*? \1\s*=>\s*/(\S+)"
RewriteRule ^catalog\.php$ http://site.ru/%2? [L,R=301]
RewriteCond %{QUERY_STRING} (^|&)id=1($|&)
RewriteRule ^catalog\.php$ http://site.ru/id=1? [L,R=301]
RewriteCond %{QUERY_STRING} (^|&)id=27($|&)
RewriteRule ^catalog\.php$ http://site.ru/ciatim-221? [L,R=301]
DirectoryIndex index.php
(?!.*</body>)
RewriteCond %{HTTP_HOST} ^domain\.com$
RewriteRule ^link http://subdomain.domain.com/ [P]
include /etc/nginx/conf.d/*.conf;
# www -> ssl non www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# non ssl -> ssl
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]
RewriteCond %{THE_REQUEST} ^[^?]+//
RewriteRule .* https://site.ru/$0 [R=301,L]
# SEO URL Settings
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[^?]+//
RewriteRule .* https://site.ru/$0 [R=301,L]
RewriteCond %{QUERY_STRING} &product_id=2548(&|$)
RewriteRule ^(.*)$ https://site.ru/ryukzaki/gorodskie-ryukzaki/ryukzak-hedgard-4350-kofe? [L,R=301]
# www -> ssl non www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# non ssl -> ssl
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#-----
# RewriteCond %{QUERY_STRING} (^|&)route\=extension/feed/google_sitemap($|&)
# RewriteRule ^index\.php$ /map.xml? [L,R=301]
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
!-f
срабатывает если запрашиваемый адрес не файл и /administrator/ подходит под это условие, так как является существующим каталогом.Достаточно поменять условие на
!-d
.nginx.org/ru/docs/http/ngx_http_rewrite_module.html#if