Put the following directives in your server
block. nginx will then redirect URLs with double (or triple or multiple) slashes to the corresponding URL with a single slash.
merge_slashes off;
rewrite ^(.*?)//+(.*?)$ $1/$2 permanent;
Put the following directives in your server
block. nginx will then redirect URLs with double (or triple or multiple) slashes to the corresponding URL with a single slash.
merge_slashes off;
rewrite ^(.*?)//+(.*?)$ $1/$2 permanent;
rewrite ^([^.]?/)/+(.)$ $1$2 permanent;
@yuri-zubov Thank you, your solution is the best it's avoiding many redirects
the redirect is working fine for pure IP address but when I tried it in a domain it didn't worked
any suggestions?
how to redirect it to no slash, just remove all the slashes?