The reason I need to proxy with mod_proxy after a rewrite is because I need to check and see if the request can be satisfied from our static cache of mirrored sites using mod_rewrite's -s and -d flags. If the request cannot be satisfied from the filesystem, the request must be rewritten again back to normal and proxied to the remote host. We want it to appear to the user as though they are receiving the request from the actual server and to have it reflect as much in the users address bar. This works for most requests that require an actual proxy, but it does not work for those sites requiring basic, NTLM, or https authentication. We're not concerned with https because our server won't support it, but we do need basic and NTLM to work. When using ProxyRequests on, this works with all three forms of authentication, but the rewrite rules are skipped. The ideal situation would be to rewrite and use ProxyRequests on in the event of an actual proxy, rather than with the [P] flag. It appears that the [P] flag only has limited access to mod_proxy's functionality. So, this is why we need to do this. Our server is complicated and pretty unconventional. I can elaborate further about the goal and intent of our server if necessary. -----Original Message----- From: Joshua Slive [mailto:jslive@xxxxxxxxx] Sent: Wednesday, August 10, 2005 11:58 AM To: users@xxxxxxxxxxxxxxxx Subject: Re: [users@httpd] [P] flag in mod_rewrite On 8/10/05, Anthony Browne <aabrowne@xxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx --------------------------------------------------------------------- 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@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx