Search code examples
mod-rewritecross-domainroutestemporary

Temporarily route all traffic (new site) to other domain? Best practice?


For a client I need to temporarily route their traffic to my own subdomain. Their host (a shared host) needs to be reconfigured for the site to work, but the client wants their site online ASAP (what else is new ;-)

Considering the following:

  • It's a new site/new domain, so there is no legacy SEO traffic.
  • Preferably I'ld like the clients domain to stay in the addressbar of visitors browser
  • On my subdomain all traffic will be routed with mod_rewrite following the front controller pattern (i.e. http://example.com/some-seo-url/ will be handled by index.php)
  • Edit my own host is a shared host as well, so I don't have access to virtual hosts definitions.

What is the best practice to route all their traffic to my own subdomain for a while?

Please advice as to how this can best be achieved.


Solution

  • You could add a CNAME entry with their domain manager to point to your domain. Give it a time-to-live of the shortest period possible so that clients' DNS records will get refreshed ASAP.

    As far as handling it on your end, the front controller pattern should help you sort out things coming from www.theirdomain.com and www.yourdomain.com.

    To test, you can add an entry in your hosts file for www.theirdomain.com and point it to your servers and make sure everything is on the up-and-up before you mess with DNS records.