Answer the question
In order to leave comments, you need to log in
What do these redirects mean in Nginx?
Help define what each rewrite/redirect means.
rewrite ^/(.*)/$ /$1 permanent;
if ($request_uri ~* "\/\/") { rewrite ^/(.*) $scheme://$host/$1 permanent; }
rewrite ^/(.*)\.html /$1/ permanent;
if ($request_uri ~* "^(.*/)index\.php$") {
return 301 $1;
}
if ($request_uri ~* "^(.*/)index\.php(/?)(.*)") {
return 301 $1$3;
}
Answer the question
In order to leave comments, you need to log in
So here it is in detail. We must try to understand how it works, and not stupidly memorize.
ngx_http_rewrite_module
$request_uri
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question