httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jsl...@gmail.com>
Subject Re: [users@httpd] [P] flag in mod_rewrite
Date Wed, 10 Aug 2005 16:57:42 GMT
On 8/10/05, Anthony Browne <aabrowne@widernet.org> 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
cases):

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

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message