rewriting a url with a ? in it not working

jimxms nginx-forum at
Sun Dec 20 13:41:50 MSK 2009

Hi All,

I've just recently moved over to nginx, so please excuse my stupidity if this is a really easy one to solve.

I have the following URL:

which I am trying to rewrite to:

I'm using the following in my nginx config:

rewrite ^/content.php?/(\w*)/(\w*)/(\w*)$ /content/$1/$2/$3 last;

however when I visit the URL to be rewritten the vars $1 $2 $3 are not being passed to the content script. Interestingly though, if I visit:  (notice the lack of ?)

It works fine.

Any assistance much appreciated.

Posted at Nginx Forum:,32076,32076#msg-32076

More information about the nginx mailing list