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]
RewriteRule ^catalog/razdel-\(strahovka\)/$ https://site.ru/catalog/razdeli/razdel-/? [R=301,L]
location /link/ {
proxy_pass https://site1.ru/;
/link/
будет заменён на /
в итоге получится https://site1.ru/pDK9VJacsrb9bway?no=2location /link/ {
proxy_pass https://site1.ru;
proxy_set_header Host $host;
server {
listen 443 ssl http2;
server_name alias.domen.ru;
ssl_certificate ... ;
ssl_certificate_key ... ;
return 301 https://domen.ru/link/landing;
}
if
чтобы избежать зацикливания.if ($host = alias.domen.ru) {
return 301 https://domen.ru/link/landing;
}
kubectl get pods -n mainspace | sed 's/-[0-9].*//' | sort | uniq -c
kubectl get pods -n mainspace | awk -F'-[0-9]' '{a[$1]++}END{for (x in a) print x,a[x]}'
grep -oP '^[a-z]+(-[a-z]+)*'
grep -oP '^.+?(?=-\d|$)'
sed 's/-[0-9].*//'
В итоге перелинковка идет на https://newsite.ru/pesok/kvarceviy-pesok/, то есть добавляет в конец лишнее
Redirect 301 / https://newsite.ru/
оно и срабатывает.Redirect 301 /pesok/kvarceviy-pesok/ https://newsite.ru/pesok/
Redirect 301 / https://newsite.ru/
RedirectMatch 301 ^/$ https://newsite.ru/
RedirectMatch 301 ^/pesok/kvarceviy-pesok/$ https://newsite.ru/pesok/
PJSIP/(\d+)\S+ Up ([\d:]+).+?<(\d+)>
$str = '
Channel: Exten: CLCID: ========================================================================================== Channel: PJSIP/739-00009cf3/Dial Up 00:01:15 Exten: s CLCID: "CID:9622088888" <79379853222>
Channel: PJSIP/814-00009cf5/Dial Up 00:00:25 Exten: s CLCID: "CID:9622088888" <89119120799>
Channel: PJSIP/BEELINE_9622088888-00009cf4/AppDial Up 00:01:13 Exten: CLCID: "" <9622088888>
Channel: PJSIP/BEELINE_9622088888-00009cf6/AppDial Up 00:00:25 Exten: CLCID: "" <9622088888>
Objects found: 4
';
preg_match_all('~PJSIP/(\d+)\S+ Up ([\d:]+).+?<\K\d+~s', $str, $m, PREG_SET_ORDER);
print_r($m);
location /sandbox/hello/ {
try_files $uri $uri/ /sandbox/hello/index.php$is_args$args;
}
server {
listen 80;
listen [::]:80;
root /var/www/example_com;
index index.html index.php;
server_name example.com;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location /sandbox/hello/ {
try_files $uri $uri/ /sandbox/hello/index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Регулярные выражения задаются либо с модификатором “~*” (для поиска совпадения без учёта регистра символов), либо с модификатором “~” (с учётом регистра).
(?<name>...)
set $test $1;
location ~ ^/(?<test>test-a-[0-9]|test-b-[0-9]) {
proxy_pass http://$test;