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$ {
^amp
будет работать в RewriteRule, а для RedirectMatch нужно добавить "/" ^/amp
RedirectMatch 301 ^/amp/[0-9]*\.html$ https://site.ru/
RewriteRule ^amp/[0-9]*\.html$ https://site.ru/ [R=301,L]
if ($request_uri ~ "^/catalog/search/\?q=(.*)") {
return 301 /catalog/?search=$1;
}
location = /catalog/search/ {
if ($args ~ "^q=(.*)") {
return 301 /catalog/?search=$1;
}
}
location = /catalog/search/ {
return 301 /catalog/?search=$arg_q;
}
$ar = array('Parameter #0 [ $operationName ]', 'Parameter #0 [ $operationName ]', 'Parameter #0 [ $operationName ]');
preg_match_all('/(?<=\[).+?(?=\])/' , implode($ar), $matches);
print_r($matches[0]);