https://site.ru
или https://%{HTTP_HOST}
RewriteCond %{THE_REQUEST} ^[^?]+//
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
<Directory>
доступна только в server config, virtual host.<Directory not allowed here
AllowOverride None
на AllowOverride All
sudo a2enmod rewrite
sudo service apache2 restart
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^shop/catalog/(.*)$ /shop/catalog.php?category=$1 [L,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^shop/(.*)$ /shop/tovar.php?id=$1 [L]
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.*)$ $1.php [L]
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))$">
*.init.js
файлы. RewriteCond %{QUERY_STRING} (?:^|&)sort=
(?:^|&)
можно сразу в начало проверяемой строки %{QUERY_STRING} добавить &
.RewriteCond &%{QUERY_STRING} &sort=
RewriteCond &%{QUERY_STRING} &sort=|&display=
RewriteCond &%{QUERY_STRING} &(PAGEN_1=\d+) [OR]
RewriteRule ^catalog/.+$ /$0?%1 [R=301,L]
&
в конец проверяемой строки можно избавиться от (?:$|&)
RewriteCond &%{QUERY_STRING}& &sort=(?:SHOWS|NAME|PRICE)&|&display=(?:block|list|table)&
RewriteCond &%{QUERY_STRING} &(PAGEN_1=\d+) [OR]
RewriteRule ^catalog/.+$ /$0?%1 [R=301,L]
RewriteCond %{QUERY_STRING} (?:^|&)p=
RewriteRule ^ https://site.ru/? [R=301,L]
RewriteCond %{THE_REQUEST} " /dop_pages/([^?]+)/index\.html"
RewriteRule ^ /%1/ [R=301,L,NE]
RewriteCond %{DOCUMENT_ROOT}/dop_pages/$1/index.html -f
RewriteRule ^(.+)/$ /dop_pages/$1/index.html [L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{QUERY_STRING} mode=archive
RewriteCond %{QUERY_STRING} ^(?=.*?year=(\d+))(?=.*?number=(\d+))
RewriteRule ^index\.php$ /ru/archive/%1/%2/? [R=301,L]
RewriteCond %{THE_REQUEST} ^\S+\s/index\.php\?(?=.*?mode=archive)(?=.*?year=(\d+))(?=.*?number=(\d+))
RewriteRule ^ /ru/archive/%1/%2/? [R=301,L]
index.php
, а параметры dispatch=discussion.view&thread_id=1
следует искать в %{QUERY_STRING} или %{THE_REQUEST}.RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{QUERY_STRING} (?:^|&)dispatch=discussion\.view(?:$|&)
RewriteCond %{QUERY_STRING} (?:^|&)thread_id=(\d+)(?:$|&)
RewriteRule ^index\.php$ /reviews/%1/? [R=301,L]
RewriteRule ^reviews/(\d+)/$ /index.php?dispatch=discussion.view&thread_id=$1 [L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^(.*)\.html$ /$1 [R=301,L]
RewriteCond %{DOCUMENT_ROOT}/$1.html -f
RewriteRule ^([^.]+)$ /$1.html [L]
RewriteCond %{QUERY_STRING} (?:^|&)page=(\d+)
RewriteRule ^(.*)$ /$1page/%1/? [R=301,L]