rewrite with $request_uri auto appends args
nginx-forum at nginx.us
Fri Nov 5 20:08:47 MSK 2010
I've been using the following code to redirect non-www to www-refixed
rewrite ^ http://www.example.com$request_uri permanent;
However, I just realized that when there is a query string, the
resulting URI has the query string twice. For example:
...is rewritten as:
Is this the correct behavior?
I can add a '?' to the end of $request_uri to make it work as expected,
but I've never seen that in any examples, and I didn't think rewrite was
supposed to auto-append the arguments unless I explicitly put arguments
on the replacement side.
I'm running Nginx 0.8.52.
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,148047,148047#msg-148047
More information about the nginx