Simple Rewrite Question

Chris Sturgill chris at
Fri Feb 6 22:53:25 MSK 2009

I promise I've paid due diligence trying to solve this one through 
Google, but just can't come up with the solution (I've probably 
overlooked something very simple).

In Apache, I can forward a captured variable from a RewriteCond check 
like this:
RewriteCond %{QUERY_STRING} tag=(.*)
RewriteRule ^fastsearch(.*) /tags/%1? [L,R=301]

but I can't seem to find the nginx equivalent as the following doesn't work:
if ($query_string ~ "tag=(.*)") {
    rewrite ^/fastsearch.* /tags/%1? permanent;

My server admin is requiring that we run the stable version (0.6.35) so 
I can't use the $arg_PARAMETER introduced in 0.7.*.

What am I missing?


More information about the nginx mailing list