Answer the question
In order to leave comments, you need to log in
How to rewrite request in nginx?
Two hours of googling and trying came up with nothing.
Please tell me how to redirect a link like www.site.ru/product/?PAGEN_1=1 with a server response 301 to a link like www.site.ru/product .
At the same time, www.site.ru/product/?PAGEN_1=2 should not be redirected.
Answer the question
In order to leave comments, you need to log in
Hello!
In theory it should work like this:
if ( $request_uri ~ '^/tovar/' ) {
return 301 "../";
}
define "view reference".
In general:
if ( $arg_PAGEN_1 = "1" ) { return 301 http://..... ; }
Or $arg_... != "" (that is, not empty).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question