Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a proxypass rule in place for my website's support page ( to redirect to a thirdparty hosted web site ( the sites link's themselves are all on the seperate domain. Is there a way I can maintain the proxy session so that links clicked within the session also pass through the proxy and maintain the "correct" url that I wish the users to see?

share|improve this question

To masquerade the domain, you would use the below rules.

ProxyPass /support
ProxyPassReverse /support

Any URI links on the remote site would need to be relative, so that, when clicked, they remain inherently relative to your domain. For example:

<a href="faq.html">


<a href="">

If for some reason you have no control over the content of the remote site (I don't see why you wouldn't), there is no Apache module that parses pages. You would need to create a script that serves those requests from your server. The script would act as the proxy: fetching the pages from the remote site, parsing the content and rewriting the HTML (URIs) before returning it to the end-user.

There are a handful of challenges that arise when creating this type of script. A couple that come to mind are images and css files. You will need to decide if you will handle serving the images through your site or make the script such that it doesn't rewite image URLs. If the image references are relative, you will need to serve them or make the script such that it rewrites those relative paths with the remote source domain. You will have similar issue with css files. Another is "HTTP_REFERER" rules. While rare, if the remote site has any "HTTP_REFERER" rules, those items won't work.

It certainly is not impossible, but you will need to account for many possibilities.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.