(?!...)
, то можно попробовать заменить -(\d{1,3})-
на -(7([0-689]\d?|7[0-689]?)?|3([02-9]\d?|1[0-46-9]?)?|[0-24-68-9]\d{0,2})-
preg_replace('#якорь|\[special\].*?\[/special\](*SKIP)(*F)#s', 'TXT', $str);
RewriteEngine on
RewriteRule ^games/(games/StreamingAssets/aa/settings\.json)$ https://site.com/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{QUERY_STRING} (?:^|&)q=%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D0%B8-%D0%94%D0%B5%D1%82%D1%81%D0%BA%D0%B8%D0%B5\+%D0%BA%D1%80%D0%BE%D0%B2%D0%B0%D1%82%D0%BA%D0%B8(?:$|&)
RewriteRule ^2-glavnaya$ /? [R=301,L]
try_files $uri $uri/ /index.html$is_args$args;
try_files $uri $uri/ /index.html =404;
location / { try_files $uri $uri/ =404; } rewrite ^/([a-z,0-9,-]+)$ /pages/$1.html last;
location / {
try_files $uri $uri/ /pages$uri-$arg_p.html /pages$uri-1.html /pages$uri.html =404;
}
rewrite ^/([a-z0-9-]+)$ /pages/$1-$arg_p.html last;
location ~ ^(/pages/.+)-\.html$ {
internal;
try_files $1-1.html $1.html =404;
}
location ~ ^/pages/.+\.html$ {
internal;
try_files $uri =404;
}
location / {
rewrite ^ /index.html break;
}
location = /api/ {
proxy_pass http://localhost:4200;
}
RewriteRule ^articles/\xAA\xDD/$ /articles/ [L,R=301]
RewriteRule ^articles/.*[^\s\w/] /articles/ [L,R=301]
RewriteEngine On RewriteCond %{REQUEST_URI} ! \.html$ RewriteCond %{REQUEST_URI} ! /$ RewriteRule ^(.*)$ $1.html
! \.html$
и тут ! /$
пробелов быть не должно, иначе ошибка синтаксиса.^(.*)$
на ^([^.]+)$
чтобы не ловило файлы css, js.RewriteEngine On
RewriteCond %{REQUEST_URI} !\.html$
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^([^.]+)$ /$1.html [L]
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/$1.html -f
RewriteRule ^([^.]+)$ /$1.html [L]
location / {
proxy_pass http://backend;
}
location ~ ^/(smokeping|pgadmin4) {
allow 192.168.11.0/25;
deny all;
proxy_pass http://backend;
}
location / { try_files $uri $uri/ =404; }
location / {
try_files $uri $uri/ =404;
}
location /home/downloadsites/ {
root /;
}
/.htaccess
RewriteEngine On
RewriteRule .* frontend/$0 [L]
/frontend/.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.html [L]
/api/.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
<Files "users.json">
deny from all
</Files>
location / { if (!-e $request_filename){ rewrite ^/(.*) /index.php?code=$query_string; } location ~ [^/]\.ph(p\d*|tml)$ { try_files /does_not_exists @php; } }
location / {
}
location ~ ^/dir/([0-9A-Za-z]*)$ {
try_files $uri /dir/index.php?code=$1&$args;
}
location @php {
на location \.php$ {