Answer the question
In order to leave comments, you need to log in
How to make a redirect from slash to without slash when url with parameters?
Hello, please tell me, you need to make a 301 redirect from a slash to without a slash.
To do this, I write in the config like this:
location ~ ^(.+)/$ {
return 301 $1$is_args$args;
}
rewrite ^/(.*)/$ /$1 permanent;
https://domain.com/test/?page=4
https://domain.com/test/?page=5&view=grid
https://domain.com/test?page=4
https://domain.com/test?page=5&view=grid
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question