#(<a\b.+?</a>(*SKIP)(*F)|помощник)#s
http://sandbox.onlinephpfunctions.com/code/b40cda9e2584294146c12245c6fbad45f65f16d5
Тогда поменять RewriteCond %{REQUEST_URI} !^/search
на RewriteRule ^(search)$ /?path=$1 [L,QSA]
И добавить ниже исключение, чтоб не открывалось /search.html
RewriteEngine On RewriteCond %{HTTP_HOST} ^www.site.com$ [NC] RewriteRule ^(.*)$ http://site.com/$1 [R=301,L] RewriteRule ^(search)$ /?path=$1 [L,QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-zA-Z0-9/_\-]+)$ http://site.com/$1.html [R=301,L] RewriteCond %{REQUEST_URI} !=/search.html RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-zA-Z0-9/_\-]+)\.html$ /?path=$1 [L,QSA]
sercher, нужно поменять местами правила.
ivcou, для исключения достаточно добавить RewriteCond %{REQUEST_URI} !^/search
RewriteEngine On RewriteCond %{HTTP_HOST} ^www.site.com$ [NC] RewriteRule ^(.*)$ http://site.com/$1 [R=301,L] RewriteCond %{REQUEST_URI} !^/search RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-zA-Z0-9/_\-]+)$ http://site.com/$1.html [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-zA-Z0-9/_\-]+)\.html$ /?path=$1 [L,QSA]
Вероятно, поставили редирект после подобной конструкции:
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [L]
Нужно просто перенести редирект повыше.
https://habrahabr.ru/company/sprinthost/blog/129560/
RewriteCond %{REQUEST_URI} ^(.*/)index\.(php|html?)$ RewriteRule ^ %1 [R=301,L]
Или так
RewriteRule ^(.*/)?index\.(php|html?)$ /$1 [R=301,L]
После редиректа новый адрес начинается на /cat/ и снова подходит под условие !^/(help|contacts|about)/
/verona/cat/subcat -> /cat/subcat?region=verona -> /subcat?region=cat
Можно дополнительно проверять %{QUERY_STRING} на наличие region.
RewriteCond %{QUERY_STRING} !^region=
RewriteRule ^_(.+?)_?(\.html)$ /$1$2 [R=301,L] RewriteRule ^(.+)_(\.html)$ /$1$2 [R=301,L]
Или одним правилом.
RewriteRule ^(?|_(.+?)_?|(.+)_)(\.html)$ /$1$2 [R=301,L]
<FilesMatch "\.html\?page=\d+$"> ForceType 'text/html; charset=utf-8' </FilesMatch> RewriteEngine On RewriteCond %{QUERY_STRING} ^page=\d+$ RewriteRule ^.*\.html$ $0%\3f%0 [L]
RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://сайт.ru%{REQUEST_URI} [L,R=301] RewriteCond %{THE_REQUEST} " /index\.php(?:/(\S*))?" RewriteRule ^ /%1 [R=301,L] #301 редирект со / на без RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ /$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA]