nginx rewrite for an url with parameters
- by David
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.