Solved

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

Posted on 2011-02-16
15
533 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 33

Expert Comment

by:paulmacd
Comment Utility
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
Comment Utility
Make sure your domain is registered and your DNS points to your server.
0
 
LVL 3

Expert Comment

by:QuinnDester
Comment Utility
using a rewrite you can make sure the user comes in on www.example.com even if they type in example.com
0
 
LVL 4

Expert Comment

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

Author Comment

by:rgb192
Comment Utility
>>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 33

Expert Comment

by:paulmacd
Comment Utility
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
Comment Utility
>>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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 33

Expert Comment

by:paulmacd
Comment Utility
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
Comment Utility
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
Comment Utility
when I use another computer
I go to website.com
and see what I see on localhost using remote desktop
0
 
LVL 33

Expert Comment

by:paulmacd
Comment Utility
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
Comment Utility
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
Comment Utility
Check the host headers.
Maybe you didn't specify the correct host headers in IIS
0
 
LVL 3

Expert Comment

by:QuinnDester
Comment Utility
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
Comment Utility
this works thanks
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I have been working as System Administrators since 2003. I recently started working as a FreeLancer and was amazed to find out that very few people are taking full advantage of their Windows Server Machines. Microsoft Windows Server comes with so…
OfficeMate Freezes on login or does not load after login credentials are input.
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 show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

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

16 Experts available now in Live!

Get 1:1 Help Now