Solved

I want example.com to redirect to www.example.com

Posted on 2011-02-16
15
544 Views
Last Modified: 2012-06-22
In windows server 2008
I set up a domain name (www.example.com)

but example.com  goes to localhost

I want example.com to redirect to www.example.com
0
Comment
Question by:rgb192
  • 5
  • 4
  • 3
  • +2
15 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 34908614
Are you in a domain?  If so example.com is likely the name of the domain so resolves to a domain controller.

If not, it should just be a matter of configuring DNS so example.com points to the IP address of the machine named www
0
 
LVL 9

Expert Comment

by:meko72
ID: 34908617
Make sure your domain is registered and your DNS points to your server.
0
 
LVL 3

Expert Comment

by:QuinnDester
ID: 34908648
using a rewrite you can make sure the user comes in on www.example.com even if they type in example.com
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 4

Expert Comment

by:reijer
ID: 34908764
You can also make a cname record in dns. www.dxample.com cname to example.com
0
 

Author Comment

by:rgb192
ID: 34909268
>>using a rewrite you can make sure the user comes in on www.example.com even if they type in example.com

which folder should this .html file go into



i want to have this work with my dedicated windows server 2008 hosting
I dont want to change using a domain registry
0
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 34910138
When you say "...but example.com  goes to localhost...", do you mean when you browse to "http://example.com", your web browser displays "http://localhost"?

Also (and this depends a lot on how you have DNS set up) example.com and www.example.com may both point to the same place from outside your network, but they can point to different places from inside your network.  So what is the test setup you're using?

Lastly, because example.com and www.example.com may both point to the same place from outside your network, there would be no point in redirection because you'd be redirecting vistors to the same page.
0
 

Author Comment

by:rgb192
ID: 34910194
>>When you say "...but example.com  goes to localhost...", do you mean when you browse to "http://example.com", your web browser displays "http://localhost"?


no redirection
but
http://example.com and http://localhost are the same content
but the urls are different



>>Also (and this depends a lot on how you have DNS set up) example.com and www.example.com may both point to the same place from outside your network, but they can point to different places from inside your network.  So what is the test setup you're using?



I dont know, but I want to use just windows server 2008 and not the domain registry

0
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 34910221
So you're sitting on the web server and you're surprised when the browser pulls content from localhost?  I wish I'd understood that from the beginning.  The solution is to browse the web site from a different computer.  No one else will see localhost unless they're sitting on the web server itself, like you are.
0
 
LVL 3

Expert Comment

by:QuinnDester
ID: 34911232
rewriting isnt redirection, you are rewriting example.com to www.example.com done with a 301 this has the effect of removing example.com completely from the search engines, and stops any confusion over duplicate content
0
 

Author Comment

by:rgb192
ID: 34918174
when I use another computer
I go to website.com
and see what I see on localhost using remote desktop
0
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 34918239
Your ability to write
haiku entertains
but makes troubleshooting hard.

"...and see what I see on localhost using remote desktop"  Which is what?  Is it something you don't expect to see?  Is it something you don't want to see?  What should be different?  When you visit the site using a web browser from a machine that isn't the web server, are you saying it still comes up with "http://localhost"?

0
 

Author Comment

by:rgb192
ID: 34919285
when I go to http://localhost on remote desktop
I see a picture of iis that when I click on this picture goes to iis.net

http://www.example.com works
but
http://example.com displays the same picture of iis
0
 
LVL 4

Accepted Solution

by:
reijer earned 500 total points
ID: 34923898
Check the host headers.
Maybe you didn't specify the correct host headers in IIS
0
 
LVL 3

Expert Comment

by:QuinnDester
ID: 34924450
that sounds like example.com isnt directed at the website in iis, and iis is automatically routing it to the default web folder.

go into iis and point example.com to the same folder as www.example.com
0
 

Author Closing Comment

by:rgb192
ID: 35049754
this works thanks
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

861 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