I develop websites at my home office, then upload them to the production webserver when they are done.
I needed to mimic the exact setup of the production webserver, but I don't have a dns machine. My ISP provides DNS, so I couldn't add to their records, and I didn't want to setup DNS on my development "do-it-all" test machine.
So I needed to reference these websites by a root level domain name, instead of a folder under localhost, to ensure that functions that checked the URL for folder names would display the correct menu selection, etc.
I also needed to create vitual directories to use the server side include feature in ASP
<!--#Include Virtual="include/header.asp" -->
Step 1. Search for a file on your computer called HOSTS
I found mine in c:\winnt\system32\drivers\etc
Step 2. Open this file in notepad. At the end of the file you should see an entry that looks like this
127.0.0.1 localhost
that means that if you type localhost in your web browser, it will connect to your local copy of IIS and display the page in your c:\inetpub\wwwroot\ folder
add a line to the bottom of the file for the internal site you wan to connect to. Since this is an internal site, and I don't want it to conflict with my browsing of the "real" public website, I use the domain suffix ".int". Here is my example:
127.0.0.1 MySite.int
Save the file from notepad, without any extension, "HOSTS"
Step 3. Open IIS Mgr
Add a new website, and specify it to use the host header name, in this example "MySite.int"
Test it by opening your web browser and typing "MySite.int" into the address bar, it should connect to the website files specified when you created the website in IIS
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.