You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jason Yates <jy...@dataservice.org> on 2002/07/25 20:01:52 UTC

mod_rewrite proxying

Here are the applicable parts of the httpd.conf.

ProxyRequests off
Nocache *
RewriteEngine on
RewriteLog logs/rewrite
RewriteLogLevel 0
RewriteRule ^/$ /home/ [R]
RewriteRule ^/home(.*)$ /var/www/html/$1 [S=1]
RewriteRule ^/(.*)$ http://www1.foo.com/$1 [P]

Everything in the home/ directory is on the local server.  Everything else
needs to be proxyied to www1.foo.com.

The only problem with this configuration is redirects coming from
www1.foo.com don't get caught by mod_rewrite.  For instance, if you goto the
website http://www.foo.com/bar/ the link works correctly and grabs the page
off www1.foo.com.  If you goto http://www.foo.com/bar (notice no slash), the
server www1.foo.com redirects to the directory http://www1.foo.com/bar/, and
reverse proxying is broken.

Any suggestions?

-Jason Yates




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: mod_rewrite proxying

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 25 Jul 2002, Jason Yates wrote:

> Here are the applicable parts of the httpd.conf.
>
> RewriteRule ^/(.*)$ http://www1.foo.com/$1 [P]
>
> The only problem with this configuration is redirects coming from
> www1.foo.com don't get caught by mod_rewrite.

Add
ProxyPassReverse / http://www1.foo.com/

Joshua.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org