Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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've only ever used mod_rewrite to do friendly URLs, but have a query from a client. They want a page inside a site, to be associated with a domain

The site sits on He wants the following page for example to be accessed using domain1 and domain2 point to the same server.

A simple redirect wont cut it, cause they want to hide the fact the page is under a different domain. I always thought doing mod-rewrites on domains was suicide when coming to maintainability/usability. Maybe im wrong.

Also frames are out of the question.



share|improve this question

I believe you want to proxy. Here's the Apache docs on the topic.

share|improve this answer
The two sites are on the same machine, if that makes a difference. – madphp Jan 14 '10 at 17:48
The two sites are on the same machine, if that makes a difference. – madphp Jan 14 '10 at 17:48
It doesn't. You can proxy to pretty much any other server. – David Jan 15 '10 at 1:34

If the two sites are being handled by the same Apache instance, then you probably don't even need mod_rewrite, much less a proxy. Just use Alias to add the path you want that would normally be handled from the second site's docroot into the first site at the appropriate location in the first site's virtual host definition, and a entry to allow access if needed.

If they're not, then you have to have a proxy handling all requests to the visible site that pulls the page you want from the second site when a specific location is requested, as Michael Graff suggested, because no kind of redirection or rewriting will be able to hide that you have left the main server otherwise.

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.