开发者

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

开发者 https://www.devze.com 2022-12-17 08:36 出处:网络
For a client I need to temporarily route their traffic to my own subdomain. Their host (a shared host) needs to be r开发者_如何学Goeconfigured for the site to work, but the client wants their site onl

For a client I need to temporarily route their traffic to my own subdomain. Their host (a shared host) needs to be r开发者_如何学Goeconfigured 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.


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.


Setup an Apache VirtualHost with the client's domain and change the DNS records of said domain to point to your server (with a low TTL to make the change back as instant as possible). Reload Apache's configuration and you're done

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号