You can use the hosts file (C:\Windows\System32\drivers\etc\hosts) to setup a mock host-name for local development/testing. Here is an example: I want to use http://helloworld/ locally to point to a test website.
1. Add an entry for helloworld to the hosts file.
This means that the url helloworld will be looped back to your local machine
2. Next in IIS Manager, right click on your site and select “Edit Bindings”
3. In the dialog that opens setup your default binding like so:
4. Browse to http://helloworld/
Now if you have Windows Authentication turned on, on your site, you will find that IE will not auto log you into the site, nor will you be able to log in by providing the correct credentials. The reason for this is that in Windows Server 2003 SP1 a new security functionality called “loopback check” was added, this blocks the authentication request and so for your site to work with the new-host name locally you need to disable the loopback check.
This is described in this post: http://support.microsoft.com/kb/926642, and is done via editing the registry (2 methods are provided). Here is the first method (which I like better than method 2 – which completely disables the loopback check).
Method 1: individually allow host-names
|Method 2: disable loopback check |
Copy the folllowing text into notepad, save the file with an extension of .reg and run it.
Windows Registry Editor Version 5.00