如何将域重定向到子目录?
仅使用 DNS,如何将 http://www.example.com/
重定向或解析到 http://www.anotherdomain.com/example
?
更新:
既然下面提到了不能使用 DNS,那么下一个最佳替代方案是什么(最小化服务器上的负载并为用户提供最快的重定向体验)?
Using only DNS, how can I have http://www.example.com/
either redirect or resolve to http://www.anotherdomain.com/example
?
UPDATE:
Since it's been mentioned below that DNS cannot be used, what's the next best alternative (minimize load on server and provides the fastest redirect experience for the user) ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你不能。 DNS 不处理 URL,仅将名称映射到 IP。
URL 不是 DNS 的一部分,只有域名才是。
You can't. DNS doesn't handle URLs, just maps names to IPs.
URLs aren't part of DNS, only domain names are.
正如蒂姆·霍兰所说,你不能。 您需要使用 Apache 的 URL 重写模块或重定向页面(均在 example.com 上)之类的东西。
Just as Tim Howland said, you can't. You need to use something like the URL rewrite module for Apache or a redirect page (both on example.com).