? * +
жадные.?
их можно переключить в ленивый режим ?? *? +?
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]
/s
. Тогда (.*)
будет захватывать и символы новой строки.print((lambda x: (('{0}{1}', '{1}{0}')[x[0]=='0'] + ' {3}{2}').format(*x))(sorted(input())))
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]
.*?($|\w+=-?\d+)
$1
В качестве значения можно использовать текст, переменные и их комбинации.
Если значение поля заголовка — пустая строка, то поле вообще не будет передаваться проксируемому серверу.
map $uri $a {
default "";
~^/some_uri "Basic YWxhZGRpbjpvcGVuc2VzYW1l";
}
proxy_set_header Authorization $a;
server {
server_name neel_rl.neel;
root /var/www/neel/appRlLara/legacy;
location / {
try_files $uri /index.php$is_args$args;
location ~ \.php$ {
fastcgi_pass rl.php54:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
}
location /appRlLara {
root /var/www/neel/appRlLara/public;
rewrite ^/appRlLara/(.*) /$1 break;
try_files $uri /appRlLara/index.php$is_args$args;
location ~ \.php$ {
rewrite ^/appRlLara/(.*) /$1 break;
fastcgi_pass rl.php54:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
test(.*)
совпадает с test2.test/(.*)
rewrite ^/catalog/test/(.*) /catalog/test2/$1 permanent;
geo $lan {
default no;
123.224.55.2 yes;
}
map "$lan,$geoip2_data_country_code" $allowed_country {
default no;
~^yes yes;
~,UA yes;
~,BG yes;
~,RO yes;
}