httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: [users@httpd] [P] flag in mod_rewrite
Date Wed, 10 Aug 2005 16:57:42 GMT
On 8/10/05, Anthony Browne <> wrote:
>             What does the [P] flag in mod_rewrite use to proxy requests? For
> example, the only way to rewrite a request and proxy it is with the [P] flag
> after the rewrite. I haven't been able to find a way to proxy requests after
> a rewrite with mod_rewrite without using the [P] flag. Apache seems to apply
> rules from mod_proxy before rules from mod_rewrite and, if a mod_proxy rule
> applies, the mod_rewrite rules are skipped. Why is this the case and is
> there a way around this? 

There is no way around this that I know of besides manually messing
with module ordering, which is not usually a good idea.

But the real question is: why would you need to do this?  If you are
already processing a request with mod_rewrite then it is usually much
clearer if you use mod_rewrite to ask for the proxying as well. 
mod_rewrite doesn't actually do the proxying, but simply handes it
back to mod_proxy.  So, for example, the following two directives are
essentially identical in effect (except perhaps in very special

ProxyPass /foo http://bar
RewriteRule ^/foo(.*) http://bar$1 [P]


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