Domain – website not showing with www prefix. IIS7

domainiis-7

I have just transferred my domain over to a new host so I could have a virtual server and more control.

Everything seems to work ok if I visit example.com but if I visit www.example.com I just get the IIS7 screen.

My settings for DNS have A records for both www and without pointing to the same ip address. I have a CNAME record for www pointing to example.com also

In IIS7 i have a website for named www.example.com, the app pool has the same name and the folder it uses also has the same name.

When I click test connection it has a warning for Authorisation saying cannot verify access to path.

I have 2 site bindings, one for the www prefix and one without. Both on port 80 and using the same IP address.

Is there a setting I am missing?

Best Answer

Sounds like your DNS is the problem. You describe having an A record for both www.example.... and also example.com as well as a CNAME, but you shouldn't need all of them. You should either have an A record for both names in which case a user hitting either name would be directed to the site by IP, or an A record for one and a CNAME for the other. If what you really want is to have all users hit www..... whether they type it or not, just setup the two A records (or A record/CNAME pair) and at the web server level create a redirect to so that any connections to example.com are redirected to www.example.com. The easiest way to do this is with a second website within IIS, but it can be done within the same site as well.