Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to set web site on IIS 7. I have look up many tutorial like this on http://technet.microsoft.com/en-us/library/cc772350(WS.10).aspx[^] and they all say that it should be possible to add website by entering site name, physical path and bindings information.

My problem is that the website can only work if I leave host name box empty. That means that I can run only one website under default port 80.

If I put some host name and try to access it by typing host name in browser, the browser reports "Internet Explorer cannot display the webpage"

Is this normal behavior on IIS 7, do I need to do some additional installation or configuration ? How can I solve this problem?

[EDIT]Link was formatted - LOSMAC[/EDIT]
Posted
Updated 25-May-12 3:22am
v2
Comments
ZurdoDev 25-May-12 10:40am    
You likely need to set your DNS settings. Are you trying to access it from the server or from a different machine?

1 solution

I think that ryanb31 is correct and that you need to set up DNS records.

Suppose you have www.mywebsite.com
And on IIS you have your "Default Web Site" (empty binding) and a newly created "mywebsite" (binding 'www.mywebsite.com', port 80, ip *)

When you type www.mywebsite.com in your browser and you didn't create a DNS record then your browser cannot find the server. It misses some information (the actual IP address).

So first you'll have to create a DNS A record (this connects 'www.mywebsite.com' to your IP address) to allow others to find your server. Take a look at this article: CNAME record DNS settings[^]

Now the browser can resolve your IP address and knows to find your server. IIS7 receives the request and knows how to handle this.

When you enter your IP address then no binding is found, so you are routed to your "Default Web Site" site.
When you enter www.mywebsite.com then IIS finds the binding and routes you to your "mywebsite" site.

Please note that this may not work inside your local network. It depends on your configuration, so you may need to use an external computer to test your website.


When you have only created DNS A record www.mywebsite.com and somebody types mywebsite.com in your browser, then the website is not found. Another DNS record has to be added (CNAME mywebsite.com) to route it to your server. Also IIS 7 has to be set up to handle this request, otherwise the visitor is routed to your "Default Web Site" site. So add a binding to "mywebsite" ('mywebsite.com', port 80, ip *).
In that case all requests 'mywebsite.com' and 'www.mywebsite.com' are routed to "mywebsite", while all others (including your ip address) are routed to "Default Web Site".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900