(...)(@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]
Redirect 301 /page/subpage /
нужно поменять на RewriteRule.RewriteRule ^page/subpage$ /? [R=301,L]
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Redirect 301 /files/music/ https://site2.ru/files/music/
RewriteCond %{HTTP_HOST} ^site1\.ru [NC]
RewriteRule ^files/music/.+ https://site2.ru/$0 [R=301,L]
RewriteCond %{HTTP_HOST} ^site1\.ru [NC]
RewriteRule ^files/music/.+ https://site2.ru/$0 [P]
Redirect 301 /kollekciya-proektov/ https://---.ru/index.html
Redirect 301 /kollekciya-proektov/t-100/ https://---.ru/projects.html
Redirect 301 /kollekciya-proektov/t-100/ https://---.ru/projects.html
Redirect 301 /kollekciya-proektov/ https://---.ru/index.html
RedirectMatch 301 ^/kollekciya-proektov/$ https://---.ru/index.html
RedirectMatch 301 ^/kollekciya-proektov/t-100/$ https://---.ru/projects.html
(?=;)
.*?;
использовать [^;]*
(.*?);
Откуда то берется 302 редирект.
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Или совсем убрать и настраивать редирект только через .htaccess server {
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(.*) /index.php?altum=$1;
}
location ~ \.php$ {
...
}
server {
location ~ \.php$ {
...
}
location ~ ^/(.*) {
try_files $uri $uri/ /index.php?altum=$1&$args;
}
map $uri $_uri {
~^/(.*) $1;
}
server {
location / {
try_files $uri $uri/ /index.php?altum=$_uri&$args;
}
location ~ \.php$ {
...
}