I don't know whats the correct term for it, but what I'd like is to forward users visiting domain1.com to domain2.com without changing the url in their address bar at all, ie. show contents from domain2 but without showing domain2.com in the address bar.

So for example:

User visits: http://domain1.com/path/to/internal/link/ Should be redirected to: http://domain2.com/path/to/internal/link/

Additionally, all links (<a> tags) on domain2.com should be shown as domain1.com in the statusbar and addressbar.

It is possible without using iframes or other dirty hacks that might hurt SEO?

Many thanks!


Apache mod_proxy combined with mod_rewrite can do the domain cloaking you're looking for. However, links on pages are another story. If you're serving static content, I don't know of a way to modify those. If you're serving dynamic content, the application itself would have to modify hrefs to domain1 if it sees the connection coming from the domain1 web-server (which it would if you were using mod_proxy).

For SEO impacts, I recommend asking on http://webmasters.stackexchange.com, as they're better versed in the marketing of websites than we are.

A very crude and probably incorrect method of accomplishing the domain-cloaking would be something like this in the <VirtualHost> section of the Apache config

RedirectRule $/(.*)     http://other.example.com/$1     [P]

Make sure that LoadModule mod_proxy.c is in the General section. You will definitely want to bullet-proof that, I don't have time right now to tell you how to do that.

  • erm..how? can you please give an example? thanks heaps! – Nimbuz Jul 20 '11 at 11:54
  • mod_proxy_html can rewrite the links in the output. – matthew Jul 20 '11 at 11:57
  • @matthew Ah! A third party apache module? Nifty! – sysadmin1138 Jul 20 '11 at 14:16
  • Static content that is hyperlinking to itself can just use relative URLs instead of absolute URLs, of course. – JdeBP Jul 22 '11 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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