7 messages in ru.sysoev.nginxRe: Simple Rewrite Question
FromSent OnAttachments
Stefan ScottFeb 6, 2009 10:08 am 
Stefan ScottFeb 6, 2009 10:11 am 
Igor SysoevFeb 6, 2009 10:51 am 
Chris SturgillFeb 6, 2009 11:53 am 
Igor SysoevFeb 6, 2009 11:59 am 
Chris SturgillFeb 6, 2009 3:44 pm 
Stefan ScottFeb 7, 2009 10:18 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Simple Rewrite QuestionActions...
From:Igor Sysoev (is@rambler-co.ru)
Date:Feb 6, 2009 11:59:22 am
List:ru.sysoev.nginx

On Fri, Feb 06, 2009 at 02:53:25PM -0500, Chris Sturgill wrote:

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?

if ($query_string ~ "tag=(.*)") { set $tag $1; rewrite ^/fastsearch.* /tags/$tag? permanent; }