如何在 Windows/IIS 中本地定义 URL 解析方式
我知道有一种方法可以使任何定义的 URL 解析为不同的 URL,但我不记得如何或在哪里定义此设置。
我知道这是不明确的,所以请考虑以下示例。我正在构建http://www.webapplication.com
。我已经在 IIS 7 中设置了该网站。但是,我还没有转发名称服务器来解析我的服务器,因此 URL 完全指向其他位置。但是,当我在本地访问 http://www.webapplication.com
时,我希望解析 IIS 7 网站。
我该怎么做?这是 IIS、单个浏览器(IE 或 Chrome)或其他地方(如我的网络设置)中的设置吗?
I know that there is a way to make any defined URL resolve to a different URL, but I can't remember how or where to define this setting.
I understand this is ambiguous, so consider the following example. I am building http://www.webapplication.com
. I have set up the web site in IIS 7. However, I haven't forwarded the nameservers to resolve my server yet, so the URL points to somewhere else completely. However, when I access http://www.webapplication.com
locally, I would like the IIS 7 website to be resolved.
How can I do this? Is this a setting in IIS, the individual browser (IE or Chrome) or somewhere else (like my network settings)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种方法是使用您的
HOSTS
文件。您可能需要对其进行编辑,为您的域名添加一个映射到服务器 IP 地址的条目。这是一篇描述所涉及步骤的博客文章。
One way to do this would be using your
HOSTS
file. You would want to edit it to add an entry for your domain name that maps to the IP address of the server.Here's a blog post describing the steps involved.
+1 给 optus 关于如何执行此操作的博客文章。为了确保即使 optus 提到的博客文章消失,说明也不会丢失,您需要执行以下操作:
+1 to optus for the blog post on how to do this. Just so the instructions are not lost if the blog post that optus mentions goes away, here is what you need to do: