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

x
?
Solved

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

Posted on 2011-02-16
15
Medium Priority
?
552 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

A procedure for exporting installed hotfix details of remote computers using powershell
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

916 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