1

I am running IIS7 on Windows 8.1. I want to access my asp.net mvc site from another computer within the same local network. I tried my IP address instead of the localhost. I am getting not found 404 error. Strangely, even within my own computer while localhost works the IP address doesn’t work.

3
  • localhost is 127.0.0.1 and not the same as the local IP of the machine. You need to bind to the local IP instead.
    – Tyson
    Commented Nov 6, 2014 at 23:18
  • Yes, I tried my ip address also. It didn't work!
    – user466663
    Commented Nov 6, 2014 at 23:29
  • right that's what i said =] It's not the same thing as... anyways you got answer that explains in more detail now.
    – Tyson
    Commented Nov 6, 2014 at 23:35

1 Answer 1

2

The localhost entry in your %SYSTEMROOT%\System32\Drivers\Etc\Hosts file points to 127.0.0.1 like this:

127.0.0.1       localhost

Each individual computer has the same entry. It essentially means me when used by any computer. If your IIS7 is supplying the local web site as localhost then that computer is the only one that will ever be able to reach it. You should be able to add IP addresses to II7's web site properties. In this case you would added the local network IP address of the computer; e.g. 192.168.1.10. The local network IP address can be found from a command prompt by using the IPCONFIG /all command. The preferred IP would be the one connected to a cabled connection although a wireless connection would do. You cannot add an IP address to II7 for the web site that is not already assigned to your computer or it is meaningless. You may also have to open up port 80 (http) and/or 443 (https) on your firewall.

When you have that configured correctly (and refreshed IIS7) then you would access the web site from another computer on your local LAN using ,

http://192.168.0.10/mypage.html

... where 192.168.0.10 is the IP address of the computer that you configured in IIS7 and mypage.html is the page you want to go to.

3
  • I understand what you have mentioned. But don't know how to make it to work. Strangely if I try 127.0.0.1/<mypage.aspx> also doesn't work! my host file entry is given below: 127.0.0.1 loclahost ::1 localhost
    – user466663
    Commented Nov 6, 2014 at 23:38
  • 1
    @user466663 - Have a look at Add a Binding to a Site (IIS 7) for more information. (and to the drive-by-downvoter, how about explaining the diss?)
    – user385793
    Commented Nov 6, 2014 at 23:43
  • i used up up-vote to counter act the down vote, there is no reason for this answer to be down voted.
    – Tyson
    Commented Nov 7, 2014 at 15:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .