httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Evans <>
Subject Re: [users@httpd] Re: Vanity URL Rewrites Best Practices?
Date Thu, 06 Oct 2011 16:33:57 GMT
On Thu, Oct 6, 2011 at 3:00 PM, Nick Tkach <> wrote:
> Just to answer my own question, in case it helps someone else down the
> road, what I was missing was that inside the curly braces you need to
> dereference the variable with % rather than $.  So the right version
> of what I posted above is:
>  RewriteMap vanmap txt:/tmp/map.txt
>  RewriteCond %{REQUEST_URI} ^/mmh/
>  RewriteCond %{QUERY_STRING} \%2F(\w+)\.xml$
>  RewriteRule .* /mmh/${vanmap:%1}? [L,NC,R=302]

Since this is for posterity, I have to say 'No!'.

In both the RewriteRule and the RewriteCond, %N refers to back
references in the last matched RewriteCond, and $N refers to back
references in the RewriteRule. It doesn't matter one jot that it is
'inside the curly braces', it matters where the data comes from.

This is mentioned in both the RewriteCond and the RewriteRule documentation:



The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message