DNS Apache 重定向其他地方持有的域名
一家外部公司拥有我托管的网站的多个域的名称服务器。
我托管该站点,并使用域名和域别名设置了虚拟主机:
- www.example.com
- admin.example.com
外部域还需要重定向到该站点:
- www.somedomain.com
- www.anotherdomain.com
我必须在我的虚拟主机容器文件中添加什么,才能将某个域和另一个域的所有请求重定向到主 www.example.com
(我计划管理 www 和非 www 使用 mod_rewrite 请求。)
An external company holds the name servers for several domains for a web site which I host.
I host the site and have a vhost setup with the domainName and domainAlias for:
- www.example.com
- admin.example.com
The external domains also need to redirect to the site:
- www.somedomain.com
- www.anotherdomain.com
What must I add to my vhost container file to redirect all requests for somedomain and anotherdomain to the main www.example.com
(I plan to manage the www and non www
requests with mod_rewrite.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我这样做的方法是为所有别名域创建一个新的虚拟主机容器,并将它们指向我网站中的新目录。
在新目录中,我添加了一个 mod_rewrite 脚本来将所有请求重定向到主页
The way I did this was to create a new vhost container for all the alias domains and point them to a new directory in my web site.
In the new directory I added a mod_rewrite script to redirect ALL the requests the main page