暂时将所有流量(新站点)路由到其他域?最佳实践?
对于客户,我需要临时将他们的流量路由到我自己的子域。他们的主机(共享主机)需要重新配置才能使站点正常工作,但客户希望他们的站点尽快上线(还有什么是新的;-)
考虑以下因素:
- 这是一个新站点/新域,因此没有遗留问题搜索引擎优化流量。
- 最好我希望客户端域保留在访问者浏览器的地址栏中
- 在我的子域上,所有流量都将按照前端控制器模式使用 mod_rewrite 进行路由(即 http://example.com/some-seo-url/ 将由index.php处理)
- 编辑 我自己的主机是共享的主机也是如此,所以我无权访问虚拟主机定义。
将他们的所有流量暂时路由到我自己的子域的最佳实践是什么?
请就如何最好地实现这一目标提出建议。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用他们的域管理员添加 CNAME 条目以指向您的域。给它尽可能短的生存时间,以便客户端的 DNS 记录尽快刷新。
就您端的处理而言,前端控制器模式应该帮助您整理来自 www.theirdomain.com 和 www.yourdomain.com 的内容。
为了进行测试,您可以在您的主机文件中为 www.irdomain.com 添加一个条目,并将其指向您的服务器,并确保一切正常,然后再弄乱 DNS 记录。
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.
使用客户端的域设置 Apache VirtualHost,并更改该域的 DNS 记录以指向您的服务器(使用较低的 TTL 以使更改尽可能即时恢复)。重新加载 Apache 的配置就完成了
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