Answer the question
In order to leave comments, you need to log in
How to convert these Apache redirects to nginx?
Good day. Help convert these htaccess redirects to nginx:
RewriteEngine On
RewriteCond %{THE_REQUEST} \s(\S+)\.html
RewriteRule ^ %1 [R=301,L]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule (.*) $1.html [L]
RewriteCond %{QUERY_STRING} ^(.+)$
RewriteRule ^(.*)$ [email protected]%1? [L]
Answer the question
In order to leave comments, you need to log in
map $args $_at {
default "@";
"" "";
}
server {
location ~ ^(.+)\.html$ {
return 301 $1$is_args$args;
}
location / {
try_files $uri $uri$_at$args.html $uri/ /index.php?$args;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question