iislocalhostiis-manager

Why is my local website not working in IIS


This problem has a very simple (almost silly) fix, but it took me 2 hours to discover today, and none of my searches gave the answer, so I am posting this along with the answer to help others.

I have a website set up in IIS to run locally, which has worked in the past.
The URL is like: http://localhost/mywebsite

But today when I tried to open the site, it did not work in any of my browsers (IE, Chrome, and Firefox). Even the main IIS Welcome page at http://localhost was not working.

Neither restarting the server in IIS, nor calling iisreset from a command prompt fixed it.

I compared my "hosts" file to another computer which was not having the problem. Both had the same entry for "127.0.0.1 localhost".

I checked the Services panel and verified that "World Wide Web Publishing Services" was running.

I ran "netstat -a". It showed nothing listening on port 80, but I didn't know what was causing that.

Based on suggestions I found while searching for a solution, I tried the following, none of which fixed the problem:

I still had the same problem.

What else could be causing IIS and my local website not to work?


Solution

  • Make sure the website has been started in IIS:

    So if the Start link has a Green arrow by it, that means the website is NOT running, and you need to click to start it.

    By default, web sites are started automatically when IIS is started or restarted. But if you click the link to stop the site, it will remain stopped even after you reboot the computer or restart IIS. It won't be restarted until you click Start again.