I made a website, and I called it rar.com, which happens to be a real site (that I did not create). I want my site that is listed on IIS to redirect me to a local web page instead of the external site.
- IIS –> Add website
- site name == rar.com
- set physical path to c:\rar\index.html
- Type: http, IP address: Unassigned, Port: 80
- host name http://www.rar.com
-
Add another binding with same info, but the host name is set to rar.com
-
Goto: C:\Windows\System32\drivers\etc\hosts and add the following line to the file:
127.0.0.1 http://www.rar.com
(I also tried it with rar.com) -
Go to IE, and it doesn’t work.
What am I missing here? Sorry, I’m an IIS newbie.
Environment: One machine running Windows Server 2008 R2 and IIS 7.0
You sure you saved the hosts file? Did you open and edit it as Administrator?
If your server also serves as DNS server for your workstation(s) you could also just add the rar.com domain to your DNS server and have an A-record point to the server’s address. This will not work if your workstation uses, for example, your modem/router/ISP’s DNS address.
EDIT The IP-address should not be 127.0.0.1 (which is localhost!) if you are running the browser on a workstation and the website on a server; in that case you should put the server’s IP-address in your hosts file on your workstation!