Answer the question
In order to leave comments, you need to log in
How to make a redirect with a question mark at the url in nginx and apache?
Good day. Actually for Apache there are 301st redirects of this kind:
Redirect 301 /?p=59 site.com/work-release-form
But because of the question mark, it refuses to work. It is also needed under nginx, and again
location /?=59 { rewrite ^(.*)$ /work-release-form/ redirect; }
Tried to escape a question mark - gives nothing. Please tell me the correct way.
Answer the question
In order to leave comments, you need to log in
Neither apache nor nginx considers query parameters (question mark etc.) to be part of location
location / {
if ($arg_p = 59) {
return 302 /work-release-form/;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question