httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eimantas Vaiciunas <>
Subject Re: [users@httpd] Problems configuring dynamic mod_rewrite rules with proxy
Date Wed, 04 Aug 2004 05:47:14 GMT
On Tuesday 03 August 2004 23:02, Ed Stafford wrote:
> RewriteCond %{HTTP_REFERER} /foo1/
>         RewriteRule ^/foo1/(.*)$1 [P,L]
> RewriteCond %{HTTP_REFERER} /foo1/
>         RewriteRule ^/(.*)$1 [P,L]
> RewriteCond %{HTTP_REFERER} /foo2/
>         RewriteRule ^/foo2/(.*)$1 [P,L]
> RewriteCond %{HTTP_REFERER} /foo2/
>         RewriteRule ^/(.*)$1 [P,L]
> Another thing that concerns me is I don't think I should have to have
> the RewriteCond repeated, however, if I don't, then the second rule
> doesn't seem to work.  It may be a case of still not comprehending how
> RewriteCond is parsed or used, so I'm hoping someone here can
> enlighten me.
Well you shouldn't use the [L] flag after first rewriteRule since it means 
that this is tha LAST RewriteRule and that's why you have to use another 
RewriteCond. Here how it should look:

RewriteCond %{HTTP_REFERER} /foo1/
        RewriteRule ^/foo1/(.*)$1 [P]
        RewriteRule ^/(.*)$1 [P,L]
# We leave the L flag here (^^^^^^^^) since we're matching another pattern
RewriteCond %{HTTP_REFERER} /foo2/
        RewriteRule ^/foo2/(.*)$1 [P]
        RewriteRule ^/(.*)$1 [P,L]
# And here we stop rewriting.


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