Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 www.domain2.com.

The site sits on www.domain1.com. He wants the following page for example www.domain1.com/thispage/ to be accessed using www.domain2.com. 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.

Thanks

--Mark

share|improve this question

2 Answers 2

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

 
discard

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.