You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modproxy-dev@apache.org by "Lancashire, Pete" <PL...@columbia.com> on 2002/08/13 19:33:20 UTC

Update: Need help mod_rewrite and mod_proxy :(

Well its still Apache not Microsoft Proxy server, but
getting close.

If the host, inside, the one that is being hidden has
a href that has a local reference, the proxy seems to
fail.

for example I have the file foo.html
------------------------------------------------------
<html><head></head><body>
This is /foo.html
click <a href="bar.html">here</a> to go to bar.html
<br>
click <a href="http://inside/bar.html">here</a>
to go to http://inside/bar.html
<br>
click <a href="http://inside.domain.xyz/bar.html">here</a>
to go to http://inside.domain.xyz/bar.html
</body> </html>
------------------------------------------------------

The first href will get the correct reverse proxy, the
others will not,  returning the hostname that is in the
href to the user.

Really hope there is a solution ...

Thanks again,

-pete

Re: Update: Need help mod_rewrite and mod_proxy :(

Posted by Graham Leggett <mi...@sharp.fm>.
Lancashire, Pete wrote:

> If the host, inside, the one that is being hidden has
> a href that has a local reference, the proxy seems to
> fail.

The proxy isn't failing, your html is wrong.

> for example I have the file foo.html
> ------------------------------------------------------
> <html><head></head><body>
> This is /foo.html
> click <a href="bar.html">here</a> to go to bar.html
> <br>
> click <a href="http://inside/bar.html">here</a>
> to go to http://inside/bar.html
> <br>
> click <a href="http://inside.domain.xyz/bar.html">here</a>
> to go to http://inside.domain.xyz/bar.html
> </body> </html>
> ------------------------------------------------------
> 
> The first href will get the correct reverse proxy, the
> others will not,  returning the hostname that is in the
> href to the user.

Correct.

Keep fully qualified website links out of your pages. Proxy does not 
(and cannot) parse your HTML for you. Putting hardcoded URLs in pages 
makes websites difficult to maintain anyway.

As a general rule, relative links (blah.html) will always work, and are 
the most recommended. Absolute links (/dir/blah.html) will only work if 
you keep your URL space the same on the front and the back (which is 
good practice anyway). Hardcoded links (http://inside/dir/blah.html) 
will only ever work on that server, and are unmaintainable whether you 
use a proxy or not.

To my knowledge, MS Proxy server is likely to have the same problem.

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm 
	"There's a moon
					over Bourbon Street
						tonight..."