7I need to proxy requests coming into one virtualhost over to another
virtual host on the same server. I've done this before but can't get it
working with these two virtualhosts. It works as long as I always
request the site with the trailing slash.
But when I make a request without the trailing slash (like follow a link
on a page to the /images directory), the final destination site issues a
redirect, using its own ServerName, so then the user's browser tries to
go there, which of course it cannot reach.
I thought these rewrite lines would fix it, but they don't.
RewriteEngine On
RewriteRule ^/(.*)$ to://http://finalDestinationSite/$1
RewriteRule ^to://([^/]+)/(.*) http://$1/$2 [E=SERVER:$1,P,L]
RewriteRule .* - [F]
Here is the full vhost block:
<VirtualHost 192.168.1.4>
ServerName externalSiteName
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
RewriteEngine On
RewriteRule ^/(.*)$ to://http://finalDestinationSite/$1
RewriteRule ^to://([^/]+)/(.*) http://$1/$2 [E=SERVER:$1,P,L]
RewriteRule .* - [F]
ProxyPass / http://finalDestinationSite (I've tried this with
and without a trailing slash)
</virtualhost>
---------------------------------------------------------------------
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: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]