Solved

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

Posted on 2011-02-16
15
546 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…

734 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