Solved

Forwarding a webpage to not include the 'www'

Posted on 2011-09-15
14
287 Views
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.
0
Comment
Question by:Alex_MPM
  • 8
  • 3
  • 2
  • +1
14 Comments
 
LVL 6

Expert Comment

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

Author Comment

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

Expert Comment

by:Rovastar
ID: 36545464
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
 

Author Comment

by:Alex_MPM
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'.
0
 
LVL 30

Expert Comment

by:Brad Howe
ID: 36546747
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
 

Author Comment

by:Alex_MPM
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
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
 

Author Comment

by:Alex_MPM
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').
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 17

Expert Comment

by:Rovastar
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
0
 

Author Comment

by:Alex_MPM
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.
0
 
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.

-Hades666
0
 

Author Comment

by:Alex_MPM
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.
0
 
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 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
 

Accepted Solution

by:
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.
0
 

Author Closing Comment

by:Alex_MPM
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.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

A few customers have recently asked my thoughts on Password Managers.  As Security is a big part of our industry I was initially very hesitant and sceptical about giving a program all of my secret passwords.  But as I was getting asked about them mo…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now