Forwarding a webpage to not include the 'www'

Posted on 2011-09-15
Medium Priority
Last Modified: 2012-05-12
Hi, I'm sure this is a simple solution, however trying to actually search the web for 'how to not include the www in a webpage' ect... Just does not point me in the right direction so I figured I'd ask the experts.

I have a site run on IIS7 and if you don't put the 'www' at the beginning of the web address it gives you the IIS splash screen. I want it to automatically redirect to the index.aspx page I have set. I cannot find the settings which allow for this. Any ideas? Thanks.
Question by:Alex_MPM
  • 8
  • 3
  • 2
  • +1

Expert Comment

ID: 36544096
What host headers do you have setup for the site?

Author Comment

ID: 36544110
The Http response headers only have one entry. The inherited value for asp.net.
LVL 17

Expert Comment

ID: 36545464
When we host headers in IIS we mean domian name bindings for the site.

User Interface

To use the UI

    Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).

    In the Connections pane, expand the Sites node in the tree, and then select the site for which you want to configure a host header.

    In the Actions pane, click Bindings.

    In the Site Bindings dialog box, select the binding for which you want to add a host header and then click Edit or click Add to add a new binding with a host header.

    In the Host name box, type a host header for the site, such as www.contoso.com.

    Click OK.

    To add an additional host header, create a new binding with the same IP address and port, and the new host header. Repeat for each host header that you want to use this IP address and port.


You can have as many as you want to your site.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


Author Comment

ID: 36546195
I appreciate the feedback but this made no difference. I went in and configured the binding to include www.domain.com and another one for just domain.com, and restarted the site, but it still brings forth the IIS splash when I browse to the site without putting in 'www'.
LVL 30

Expert Comment

by:Brad Howe
ID: 36546747

Just like Rovastar mentioned above but via appcmd. From the sounds of your issue you either have missed up bindings on multiple sites or bad DNS entries.

1. How many sites are hosted and running on this server?

1. Open the command prompt by clicking the start menu and typing “cmd” and hitting enter.
2. Navigate to C:\Windows\System32\Inetsrv\ by typing “cd C:\Windows\System32\Inetsrv\” on the command line.
3. In the Inetsrv folder, run the following command

appcmd set site /site.name:"Default Web Site" /+bindings.[protocol='http',bindingInformation='*:80:www.domain.com']
appcmd set site /site.name:"Default Web Site" /+bindings.[protocol='http',bindingInformation='*:80:domain.com']

Default Web Site is your own site title in the IIS Manager. You will need to change this.
* is the unassigned IP adress, If an IP is required, add it like such "

This will set your bindings properly. Please post any errors.

C. DNS lookup
 1. Open CMD and run the following
     nslookup www.domain.com Does this yield your WAN IP or Local IP?
     nslookup domain.com.          Does this yield your WAN IP or Local IP?

Let us know,

Author Comment

ID: 36549166
There are only 2 sites hosted on this server, it's a small businesses server running win 08 web server edition. Here's the error message I got when running the cmd in step 2.

c:\Windows\System32\inetsrv>appcmd.exe set site /site.name"Default Web Site" /+b
ERROR ( message:Must specify the SITE object with identifier. )

same thing when I ran it without the 'www'. And when you touched on the whole DNS thing it had not even occured to me that this could be it. But I will bet that is where it lays because there have been many changes to the infrastructure this past month and adding a new dns server/DC was one of them.

When I ran nslookup on the 'www' it directed me to the old DNS server to be authoritative over it. When I ran nslookup on the domain.com it directed me to the new server as being authoritative over the zone. how can I reconcile both to go to the new one, and still give the webpage. Thanks.

Author Comment

ID: 36549177
sorry let me add to that as well. The record I got back from the 'www' site was the record of the webserver. The record I got back from the domain.com site was the new dns servers address. So I believe domain.com is pointing to itself instead of the webserver but where is that record because you can't make a CNAME without putting something in (EG 'www' or 'ftp').
LVL 17

Expert Comment

ID: 36562292
Can we be clear

mysite.com point to your server IP and you have setup host headers/bindings and content displayed correctly
www.mysite.com doesn't point to your server to your server IP and you have setup host headers/bindings and IIS splash screen is there

What server is this pointing to? That must be returning the splash screen.

Change teh IP to the correct one and see what happens.

Test this by editing locally your hosts file

Author Comment

ID: 36562375
Thanks for your help. It's vice versa though.

domain.com   loads as IIS splash screen
www.domain.com   loads website

In DNS there is an entry for 'www' so it gets resolved to the proper address.

After doing an NSLOOKUP on both I realize that the one which isn't pointing correctly (domain.com) is pointing to my dns servers, and not to the IP address of the webserver it should be. So the problem seems to be in the dns records.

Despite this I was able to create the 'www' CNAME record, which is why www.domain.com works. But I cannot create a blank CNAME which would resolve domain.com to the proper address.

Any ideas? Thanks.
LVL 30

Expert Comment

by:Brad Howe
ID: 36562820
You need to create a blank A RECORD or forward lookup. Sounds like you have an internal domain with an external url.


Author Comment

ID: 36563460
I'll bet that is exactly it. Although when I perform an NSLookup, the other addresses which were originally there (those of my DC/DNS servers) also still show up. Should I remove the other blank A records of my DC/DNS servers, or will that create another set of problems? Because the page still loads the IIS screen.

Consider this though. IIS is installed on the other addresses listed when I do a NSLookup on domain.com. So I believe that when I enter in 'domain.com' to the browser, it is pointing me to one of my DC's which has IIS installed instead of to the webserver. Thanks.
LVL 30

Expert Comment

by:Brad Howe
ID: 36563538
At that point the only way to have a non WWW url is to create a FORWARD LOOKUP ZONE with a blank record.

This will be a Forward lookup A Record in your local Domain zone. To create a host or "A" record:

1. Start the DNS snap-in.

2. Click the DNS Server object for your server in the left pane of the console, and then expand the server object to expand the tree.

3. Expand Forward Lookup Zones.

4. Under Forward Lookup Zones, right-click the zone that you want (for example, mydomain.com), and then click New Host (A).

5. In the Name (uses parent domain name if blank) box, type the name of the host that you want to add.

6. For example, if you want to add a host record for a Web server, type mysite. And In the IP address box, type the IP address of the host that you want to add. For example, type

7. Select the Create associated pointer (PTR) record check box, and then click Add Host. You receive a message similar to the following:

8. The host record mysite.mydomain.com was successfully created.

Click OK.



Accepted Solution

Alex_MPM earned 0 total points
ID: 36589059
This question will have to go unanswered as I'm getting emails from the moderators to decide on an answer for it. Unfortunately all these ssteps have been taken and in almost all cases (ie creating a dns record for the host) were already done prior to this discussion.

Luckly this is only an issue on the internal domain, and access from outside resolves correctly. I'm sure one day I'll come acrossed what is causing this but for now it'll have to remain unsolved.

Thanks for everyones input.

Author Closing Comment

ID: 36715394
Low grading simply because the question has gone unanswered. Some comments were a little off of what the root cause could be. The issue is not dire, so I am closing the question without posting it to the KB.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question