RewriteCond %{QUERY_STRING} (?:^|&)p=(\d+)(?:$|&)
RewriteRule ^ /index.php/%1? [L,R]
RewriteCond %{REQUEST_URI} ^(.*)/(2\d{3})(-.*)$
RewriteCond %{TIME_YEAR}_%2 !^(\d+)_\1$
RewriteRule ^ https://%{HTTP_HOST}%1/%{TIME_YEAR}%3 [R=301,L]
%{TIME_YEAR} -gt $2
RewriteCond expr "%{REQUEST_URI} =~ m#^(.*)/(2[0-9]{3})(-.*)$# && %{TIME_YEAR} -gt $2"
RewriteRule ^ https://%{HTTP_HOST}%1/%{TIME_YEAR}%3 [R=301,L]
Options -Indexes
ErrorDocument 404 /404.php
<IfModule mod_php5.c>
php_flag allow_call_time_pass_reference 1
php_flag session.use_trans_sid off
#php_value display_errors 1
#php_value mbstring.internal_encoding UTF-8
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} \.(gif|jpe?g|png|ico|webp)$
RewriteRule ^(.*)$ https://site.ru/$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
</IfModule>
RewriteEngine on
RewriteCond %{THE_REQUEST} " /projekts/([^/]+)/page\.html"
RewriteRule ^ https://site.co.ua/%1 [R=301,L]
RewriteCond %{DOCUMENT_ROOT}/projekts/$1/page.html -f
RewriteRule ^([^/]+)$ /projekts/$1/page.html [L]
# line below if for Apache 2.4
<ifModule mod_authz_core.c>
Require all granted
</ifModule>
# line below if for Apache 2.2
<ifModule !mod_authz_core.c>
allow from all
</ifModule>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?module=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?%{QUERY_STRING}&module=$1 [L]
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule \.php - [L,R=404]
RewriteRule ^mailing\.html$ /index.php?mailing=1 [L]
RewriteRule ^balance\.html$ /index.php?balance=1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
/$1
не хватает явного указания https://RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ https://%{HTTP_HOST}/$1 [L,R=301]
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]