Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

Forwarding a webpage to not include the 'www'

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.
0
Alex_MPM
Asked:
Alex_MPM
  • 8
  • 3
  • 2
  • +1
1 Solution
 
tmwsiyCommented:
What host headers do you have setup for the site?
0
 
Alex_MPMAuthor Commented:
The Http response headers only have one entry. The inherited value for asp.net.
0
 
RovastarCommented:
When we host headers in IIS we mean domian name bindings for the site.

User Interface


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

from:http://technet.microsoft.com/en-us/library/cc753195%28WS.10%29.aspx


You can have as many as you want to your site.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
Alex_MPMAuthor Commented:
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'.
0
 
Brad HoweCommented:
Hi,

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.

A.IIS SITES HOSTED
1. How many sites are hosted and running on this server?

B. SITE BINDINGS
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 "192.168.1.1:80:domain.com

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,
Hades666
0
 
Alex_MPMAuthor Commented:
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
indings.[protocol='http',bindingInformation='*:80:www.domain.com']
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.
0
 
Alex_MPMAuthor Commented:
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').
0
 
RovastarCommented:
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
0
 
Alex_MPMAuthor Commented:
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.
0
 
Brad HoweCommented:
You need to create a blank A RECORD or forward lookup. Sounds like you have an internal domain with an external url.

-Hades666
0
 
Alex_MPMAuthor Commented:
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.
0
 
Brad HoweCommented:
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 192.168.1.161.

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.

Cheers,
Hades666




-Hades666
0
 
Alex_MPMAuthor Commented:
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.
0
 
Alex_MPMAuthor Commented:
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.
0

Featured Post

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.

  • 8
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now