? * +
жадные.?
их можно переключить в ленивый режим ?? *? +?
RewriteRule ^katalog/([a-z0-9-]+)(/([a-z0-9-]+))??(/page-(\d+))?/$ /category.php?cat1=$1&cat2=$3&page=$5 [L,QSA]
( а | b )
альтернативы проверяются слева направо.(/([a-z0-9-]+))??
можно заменить (|/([a-z0-9-]+))
RewriteRule ^katalog/([a-z0-9-]+)(|/([a-z0-9-]+))(/page-(\d+))?/$ /category.php?cat1=$1&cat2=$3&page=$5 [L,QSA]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old\.site\.com$ [NC]
RewriteRule ^index\.php$ https://new.site.com/Gallery2/index.php [R=301,L]
RewriteRule ^(1111111|2222222|3333333)(x[48]0\.png)$ this-image-$2 [L]
RewriteCond $1 =1111111 [OR]
RewriteCond $1 =2222222 [OR]
RewriteCond $1 =3333333
RewriteRule ^(.+)(x[48]0\.png)$ this-image-$2 [L]
(di|-m|r |s )
RewriteRule ^ru(?:/(.*))?$ /$1 [L,R=301]
AddDefaultCharset utf-8
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[^?]+//
RewriteRule ^(.*)$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
RewriteCond %{REQUEST_URI} !^/folder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^.*$ $0.php [L,QSA]
RewriteCond %{REQUEST_URI} !^/folder/
RewriteCond %{THE_REQUEST} (\S+)\.php
RewriteRule ^ %1 [R=301,L]
RewriteCond %{THE_REQUEST} ^\S+\s/flowers\.php
RewriteRule ^ https://my.site/my-flowers [R=301,L]
RewriteRule ^my-flowers$ /flowers.php [L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^flowers\.php https://my.site/my-flowers [R=301,L]
RewriteRule ^my-flowers$ /flowers.php [L]
RewriteCond %{QUERY_STRING} ^(|.*?&)param1=[^&]*&?(.*)
RewriteRule .* /$0?%1%2 [R=301,L]
AddType application/x-httpd-php .html .htm
if ($request_uri ~ "/index\.htm") {
return 301 /;
}
if ($request_uri ~ "^([^.?]+)\.htm") {
return 301 $1;
}
location / {
try_files $uri $uri/ $uri.htm$is_args$args;
}
location ~ \.htm {
try_files $uri =404;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
RewriteCond %{HTTP_HOST} ^(www\.)?domain1\.ru$ [NC]
RewriteRule ^subfolder.* http://domain2.ru/$0 [L,R=301]
RewriteRule ^\]\xFD\xEB\xE5\xEA\xF2\xF0\xEE\xE8\xE7\xE5\xF0\xE8\xF2\xE5\xEB\xFC\xED\xFB\xF5 https://site.ru/ [R=301,L]
RewriteCond %{QUERY_STRING} ^_route_=xxx$
RewriteRule ^(.*)$ https://site.ru/yyy? [R=301,L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^([0-9.]+/.+)$ ../download.php?file=$1 [L]
RewriteRule (.*) index.html [L]