I recently learned that http://www.xyz.com is not the same as http://xyz.com. I also learnt that when a user go to either site, the creator of xyz.com has the option to choose a "main" domain.

From what I know, when we type stackoverflow chooses http://stackoverflow.com over http://www.stackoverflow.com. On the other hand, Google choose http://www.google.com over http://google.com.

What are the benefits of choosing http://www.xyz.com as the main domain instead of http://xyz.com and vice-versa ?

link|improve this question

50% accept rate
feedback

closed as off topic by Shane Madden, John Gardeniers, SvenW, ErikA, MikeyB Sep 14 '11 at 3:17

Questions on Server Fault are expected to generally relate to servers, networking, or desktop infrastructure, within the scope defined in the faq.

1 Answer

It's site owner preference, but sometimes it looks nicer if you have a short domain name. You can use services like wwwizer or one that I host that redirects your "naked" domain to www.domain.com and there are mod_rewrite techniques that do the opposite and remove them. And many internet users naturally type www.domain.com so you need a copy of the site on both, or redirect.

Popping this into an .htaccess file in the root of your website makes all naked.domains go to www.normal.domains:

#Naked Domain Redirects
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^\.]+\.[^\.]+)$
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
link|improve this answer
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.