Multiple localhost:80-bound sites in IIS?

点点圈 提交于 2019-12-03 11:23:53

Your hosts file needs to match your IIS bindings, which have to match the url browser.

So if your hosts file looks like:

127.0.0.1 siteA.localhost
127.0.0.1 siteB.localhost

Your IIS bindings need to be:

site    host header       port
siteA   siteA.localhost   80
siteB   siteB.localhost   80

Finally, from the local machine, you need to browse to:

http://siteA.localhost

EDIT - If you are trying to do the above without adding the hosts entries for siteA and siteB, it won't work. DNS won't find it. So for example, what happens if you try to browse to "foo.stackoverflow.com" - the request will fail even though "stackoverflow.com" is a known address.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!