Apache 2.0 ReverseProxy - How to rewrite local URL to absolute URL ?
am 27.07.2007 23:35:24 von joesHello there
I like to setup a reverse proxy which I can use to reach any site.
Issue whixh I have is that the links of the site are not getting
rewritten to an absolute path. So how can I achieve this.
....
RewriteEngine on
RewriteLog d:\www\webmailproxy\log\proxy.log
RewriteLogLevel 1
RewriteRule ^/(.*) http://$1 [P]
If I enter the url "http://www.myproxy.com/www.google.com" I will get
the google page, but the links on that site "proxied" site are still
relative, so images css and also later search actions would not work.
i.e. www.google.com/images/logo.gif will get rewritten by the above
rule to "http://www.myproxy.com/images/logo.gif" which of course not
will work.
How can I enforce that those links are getting replaced automatically
thorugh "http://www.myproxy.com/www.google.com/images/logo.gif" ? and
this for any site? I have seen the directive "ProxyPass" or
"ProxyPassReverse" but those taking always a hardcoded hostname i,e.
ProxyPass / http://www.google.ch/
how can I achieve this dynamically together with the
RewriteEngine ?
thx
joes