Solved

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

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

627 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