I am trying to run test and production sites in ASP.NET IIS config. I have following entries in my Hosts file:
172.16.5.178 testsite ### test site
172.16.170.41 www.mysite.com ### LIVE WEBSITE
I have two problems here: I can not navigate to my test site using IP Address or using "testsite" in browser. I tried using all combinations: http://testsite, http://mysite:8080, http://mysite:80, 172.16.5.178, 172.16.5.178:80
and so on. But none of them works for me.
If I however use following entry, it works correctly:
172.16.5.178 www.mysite.com ### test site
Note that I used Test Server IP Address and actual Name from Live Site, and it worked.
Can anyone tell me why is this happening? I thought writing in Hosts file will navigate to respective IP Address no matter what I use as name. And indeed it goes to that IP address but shows "Not Found" and "HTTP Error 404. The requested resource is not found." error.
Any help?