nginx rewrite for an url with parameters
Posted
by
David
on Server Fault
See other posts from Server Fault
or by David
Published on 2010-07-15T15:50:01Z
Indexed on
2010/12/27
18:55 UTC
Read the original article
Hit count: 180
I have an URL of this type:
http://www.example.com/?param1=val1¶m2=¶m3=val3¶m4=val4¶m5=val5
And I want to redirect it to this one:
http://www.example.com/newparam/val3/val4
So I have tried this rewrite rule with no success:
rewrite "/?param1=val1¶m2=¶m3=(.+)¶m4=(.+)¶m5=(.+)" http://www.example.com/newparam/$1/$2 redirect;
Is nginx not able to deal with query parameters?
EDIT: I don't want to rewrite all petitions. I only need to rewrite that URL, without affecting the others.
© Server Fault or respective owner