https://spb.site.ru/path?query
spb.site.ru
/path
query
GET /path?query HTTP/1.1
RewriteRule ^(katalog/[^/]+/[^/]+/[^/.]+)/?$ https://www.site.ru/$1.html [R=301,L]
RewriteRule (.*) https://site.ru/ [R=301,L]
RewriteRule (.*) https://site.ru/$1 [R=301,L]
location ~ \.php$ {
добавить internal и на прямые запросы к php будет 404.не работали редиректы 301, установленные в htaccess
так у меня воркер php-fpm, а не fastcgi
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/tgtrack.ru.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}