How do I make a local site on IIS 7?

Go To StackoverFlow.com

0

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.

  1. IIS --> Add website
  2. site name == rar.com
  3. set physical path to c:\rar\index.html
  4. Type: http, IP address: Unassigned, Port: 80
  5. host name www.rar.com
  6. Add another binding with same info, but the host name is set to rar.com

  7. Goto: C:\Windows\System32\drivers\etc\hosts and add the following line to the file: 127.0.0.1 www.rar.com (I also tried it with rar.com)

  8. 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

2012-04-05 22:08
by LLL


1

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!

2012-04-05 22:11
by RobIII
Yes, I just overwrote again to make sure - LLL 2012-04-05 22:13
Check my edit; you are probably pointing rar.com to your workstation instead of your server. If this is the case you should learn a little about basic networking stuff like DNS etc :- - RobIII 2012-04-05 22:14
So I tried setting it to my IPv4 address... no luck. I'm using 2008 R2 as my development box so I figured using my localhost should work. The DNS is another box(/VM) that I do not have access to - LLL 2012-04-05 22:19
Thanks, but the workstation and the server are on one laptop. So I am still in a bind - LLL 2012-04-05 22:21
What happens if you ping rar.com? (On the commandline enter ping rar.com). Which IP is returned? You could try (also on the commandline) a ipconfig /flushdns if the wrong IP is returned. If after that the wrong IP then chances are about 99.999% that you edited your hosts file incorrectly - RobIII 2012-04-05 22:21
So the pinging is working correctly. When I set the host to either address (the ipv4 given to my machine or localhost) - LLL 2012-04-05 22:23
It fails on chrome and IE - LLL 2012-04-05 22:23
So to get this straight: IIS and the webbrowser are on the same machine. A ping rar.com returns 127.0.0.1 or the machine's IP. Is actually IIS running? When you enter rar.com in your browser's address bar you get "Grupo rar" - RobIII 2012-04-05 22:24
Yes that's correct. It's frustrating.. - LLL 2012-04-05 22:24
Last option I can think of: hard-refresh? (CTRL+F5). But that would mean IE and chrome had a cached version of the "actual rar.com"; I'm assuming that is not the case so, last resort: reboot the machine and try again - RobIII 2012-04-05 22:26
I'll try rebooting. That would be bitter-sweet. Thanks - LLL 2012-04-05 22:27
let us continue this discussion in chatRobIII 2012-04-05 22:28
I found the solution. It was looking for index.aspx instead index.htm - LLL 2012-04-05 23:20
Not to be kicking a dead horse here but next time you might want to consider to be more clear in the problem-description department. When you say "doesn't work" you have to be clear on WHAT doesn't work. I assumed the browser never "arrived" at the webserver, which it clearly must've done. You should've seen some "404" or other error, NOT the "Grupo rar" that's on rar.com which I asked you to confirm - RobIII 2012-04-05 23:40
There was no 404 error. I got this: "I want my site that is listed on IIS to redirect me to a local web page instead of the external site," as quoted from above - LLL 2012-04-06 18:46
Ads