Possible Duplicate:
Does the “canonical name” in DNS make any difference to search engines?

Mu understanding is that CNAME should be used for subdomains and www is just another subdomain. Of course I could do a 301 redirect but it seems odd to do that when I've got it working now and I'm an apache noob so I rather wouldn't mess with it.


1 Answer 1


If you set example.com and www.example.com to the same IP address (www is a CNAME of @) then it depends how you have it configured on the server. You should NEVER have a website load for both the naked domain AND the www subdomain. I would personally pick which you want to run the site on: www or naked domain. If you want to run it on www, go to http://wwwizer.com and then copy the IP ( and set it as the A-record for the naked domain, then set your www-subdomain to the IP of YOUR server. This pops a 301 redirect for anyone accessing your naked domain. If you want to REMOVE the www, and make all users use the naked domain, you will need to do some server-side config:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

You can pop that into a .htaccess or into the httpd.conf or wherever your Apache config files are. (Be sure to restart Apache if you change anything).

For SEO purposes, see here: http://www.toxzen.co.za/tutorials/item/50-to-www-or-not-to-www-that-is-an-seo-question

It's essential to use a 301 redirect either to add or remove the www. You have to choose one, and must stick with it. "It doesn't matter which you choose but you should pick one and be consistent ... So whichever you choose for aesthetic reasons should be consistently used for SEO reasons"

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