([\w\-.]+)
([\w-]+\.?(?:[\w-]+|\.(?!html?$))*)
([\w-]+\.?[\w.-]*?)(?:\.html?$|$)
Запросы с пустым значением ключа не учитываются.
map $arg_method $var {
default "";
"phone" $binary_remote_addr;
}
limit_req_zone $var zone=perip:10m rate=5r/s;
server {
rewrite ^/([^/]+)/([^/]+)/([^/.]+)$ /index.php?get1=$1&get2=$2&get3=$3;
rewrite ^/([^/]+)/([^/.]+)$ /index.php?get1=$1&get2=$2;
rewrite ^/([^/.]+)$ /index.php?get1=$1;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
$str = preg_replace_callback(
'#(<p[^>]*>)(.*?)(</p>)#si',
function ($m) {
return $m[1].str_replace('public', 'dolbi', $m[2]).$m[3];
},
$str
);
$str = preg_replace(
'#(?i:</p>|^).*?(?i:<p[^>]*>|$)(*SKIP)(*F)|<[^>]+>(*SKIP)(*F)|public#s',
'dolbi',
$str
);
location ~ /\. {
deny all;
}
/\.
ловит любые адреса где после слэша идёт точка.RewriteRule ^product/([^/]+)\.html$ /replace.php [L]
<?php
if (preg_match('#^/product/([^/]+)\.html#', $_SERVER['REQUEST_URI'], $match)) {
$str = $match[1];
$str = str_replace('ja', 'ya', $str);
$str = str_replace('_', '-', $str);
header("Location: https://site.ru/shop/{$str}/", true, 301);
die();
}
RewriteCond ya$1 ^(ya)(.*)ja(.*)|^ya(.*)
RewriteCond -%2%1%3%4 ^(-)(.*)_(.*)|^-(.*)
RewriteCond -%2%1%3%4 ^(-)(.*)_(.*)|^-(.*)
RewriteRule ^product/([^/]+)\.html$ https://site.ru/shop/%2%1%3%4/ [R=301,L]
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
RewriteCond %{QUERY_STRING} ^(.+) [NC]
RewriteRule ^(.*)$ /$1? [R=301,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.+) [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1? [L,R=301]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
%{QUERY_STRING} ^(.+)
на %{THE_REQUEST} \?
RewriteCond %{THE_REQUEST} \?
RewriteCond %{THE_REQUEST} "! /calculator/"
RewriteRule ^(.*)$ /$1? [R=301,L]
(...)(@anybody)(...)
, а в строке замены ссылаться на них $1, $3.(\s\p{Punct}*)(@anybody)(\p{Punct}*\s)
$1text$3
(?<=...)
lookahead (?=...)
(?<=\s|\p{Punct})@anybody(?=\p{Punct}|\s)
text
location ~ \.php$ {
include fastcgi_params;
fastcgi_param REQUEST_URI $request_uri;
map $request_uri $_fix_request_uri {
default $request_uri;
~^/mcs/users(/graphql/.*)$ $1;
}
server {
location ~ \.php$ {
include fastcgi_params;
fastcgi_param REQUEST_URI $_fix_request_uri;
$str = preg_replace('#<a[^>]+href="https?://site\.ru/catalog/razdel/[^>]+>(.*?)</a>#si', '$1', $str);
re.sub(r'(\d+\.\d+\.\d+)|\.', r'\1', "по состоянию на 1862 год . 17.02.2000")
server {
listen 80;
server_name example.com www.example.com;
root /var/www/example.com;
}
server {
listen 80;
server_name *.example.com;
root /var/www/$host;
}
rewrite ^/catalog/razdel-1/(.*)$ https://foo.ru/catalog/NOVIY-RAZDEL/$1 permanent;
RewriteRule ^catalog/razdel-1/(.*)$ https://foo.ru/catalog/NOVIY-RAZDEL/$1 [R=301,L]