Host File Configuration - Fake URLs

I am trying to customize my development instances so that I can fake some URLs that I have. My website has a URL and, depending on which one you visit on my website, will act differently based on the domain.

ive edited my file C: \ WINDOWS \ system32 \ drivers \ etc \ hosts to contain something like below

127.0.0.1 localhost 127.0.0.1 SomeDomain.com 127.0.0.1 MyDomain.com 

Now, if I visit localhost, everything works fine, but when I try to visit SomeDomain.com or MyDomain.com, it creates a couple of different messages depending on the browsers

Firefox - "Invalid request (invalid hostname)" Chrome - asked to enter a username / password and just click (do not enter anything) on ​​the same result as firefox

IE6- "Page cannot be displayed"

any ideas?

+8
iis localhost host
source share
1 answer

Your HOSTS file looks good. Also try adding a www version of each of them, for example: 127.0.0.1 localhost 127.0.0.1 SomeDomain.com 127.0.0.1 www.SomeDomain.com, etc.

However, the problem is probably setting up the web server. If you are using IIS, the problem is probably that you have configured host headers incorrectly.

+5
source share

All Articles