如何将域重定向到子目录?

发布于 2024-07-30 11:50:33 字数 214 浏览 1 评论 0原文

仅使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

提笔书几行 2024-08-06 11:50:33

你不能。 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.

我不在是我 2024-08-06 11:50:33

正如蒂姆·霍兰所说,你不能。 您需要使用 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文