Difference between accessing a website using Local host and IP address

asp.netauthenticationip addresslocalhosturl

I have developed an ASP.NET website and deployed into my IIS server. Now to see that my IIS is installed fine, I type local host in my address bar, and I get the welcome screen of IIS and its documentation in a separate window.

Now I gave the url of my website http://localhost/mysites/site2/Default.aspx I access my site. Also giving my IP address instead of local host like: http://192.168.1.46/mysites/site2/Default.aspx also works.

Just out of curiosity I wanted to see what happens when I give my IP address in addressbar. It asks me a user name and password saying:The server 192.168.1.46:80 requires a user name and password.

I donot know what user name and password it is asking, and as of my knowledge I thought localhost points to my own IP address internally. But what is the difference and also what username and password do I need for it?

Update: On chrome and IE just giving localhost displays the welcome screen, but on mozilla, localhost is also asking for a username and password.

Best Answer

From your description it doesn't look like an issue with setting up webserver websites by name or ip, which is the two main setups for hosting multiple sites on one web server. The urls you tried at the start have a much longer path and most likely running a separate website to the default website served from the implicit root when you don't specify any path. In other words, you're accessing different websites on your webserver. On a separate note, localhost resolves to 127.0.0.1 a.k.a. loopback address; not 192.168.1.46.

Related Topic