How do i map http://localhost:8080 to http://mysites in iis7?

血红的双手。 提交于 2019-12-01 05:13:26

As stated before, you can edit the hosts file (or update a local DNS server), so that the names point to the desired ip addresses. Some browsers have trouble with cookies when there's no DOT in the name, so you may want to do something like mysites.local or mysites.ivor

If there's something else running on port 80, You have to configure that server to proxy the requests to IIS (on port 80). If you can't run anything on port 80, you can configure the names, but you'll still need the port at the end.

If only IIS is running, you can set this up by using virtual hosts. You add a binding to the IP address, on port 80, to the DNS name you specified. You can run them all on one port as long as they have different host names.

Your hosts file would look like:

127.0.0.1 mysites
127.0.0.1 mysites2

This would let you set up bookmarks like http://mysites:8080 and http://mysites2:8081.

The next most difficult would be to set up HttpRedirection with a server on port 80. This would let you type http://mysites, and have it redirect to http://mysites:8080, which you would use from that point on.

To fully get what you want, you would need a reverse proxy set up on port 80. That's too big of a topic to cover here, but there's plenty of information available if you google it.

You can't set port with hosts file... You'll just need to access the sites as http://mysites:8080, mysites:8081, etc.

To do that, add an entry to your hosts like

127.0.0.1 mysites

(hosts is typically located at C:\WINDOWS\system32\drivers\etc\hosts)

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