dongque6377 2015-07-27 11:15
浏览 28
已采纳

在不更改地址栏的情况下将一个域重写为另一个域

I'm in the process of changing my website from one hosting to another, however I've got the problem of how to do this.

Basically the new site on the new hosting is due to go live on Monday. However the name-servers are being changed Friday. There is another domain that is going to be parked on the old hosting.

How would I (if there is a way) point the actual domain at the temporary domain without actually changing the address bar so:

User goes to www.example.com on Thursday and sees www.example.com because it is hosted on HOST1

www.example123.com gets parked on www.example.com's hosting Friday and the name-servers for www.example.com are changed to HOST2.

When a user goes to www.example.com on Friday, Saturday or Sunday can I, and how would I, show the user www.example123.com but still keep the address bar as www.example.com

If there is a way to do this in either PHP or HTAccess rather than using the DNS settings that would be great. The reason we are doing this is so that when we actually go live with the site it doesn't take 2-24 hours to propagate through the internet and not be the same live time across the world.

I understand if this isn't doable but need to ask as its a precaution that my work are putting in place to avoid traffic going to the new site, and propagating early.

Thanks for any advice, assistance and solutions in advance

  • 写回答

1条回答 默认 最新

  • douyun8885 2015-07-28 03:09
    关注

    Link to previous post discussing differences between redirect, rewrite, and virtual hosts.

    What it sounds like you're trying to do can be accomplished by setting up your new content in the new location (using a new name for testing) and then configure a rewrite or redirect, depending on how you want the client's browser to treat it (also some SEO implications), on the old site to load the new site's content. Normally, I've done this load balancers in front of the servers, but it can be accomplished with mod_rewrite as well.

    One of the concerns I would have is how dynamic your content is. If "switching" sites from old to new will disrupt your customers, then you would definitely want to push them off the old servers, either by redirect or rewrite, as soon as the new name comes online.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示