SEO - to www or not
Posted in typo, apache, seo Fri, 21 Jul 2006 03:25:00 GMT
Many popular sites in the Typo community have chosen not to include www. in their domain name. I was curious about this because it isn't very common in websites overall. Then I ran across a Typo Forums thread saying dropping the www. with a 301 redirect would improve SEO. I wonder if this thread or something similar in the Typo community influenced many of the sites.
Doing a little more searching I found a Digital Point thread where the general concensus is that having www. or not doesn't really matter but you should pick one and do a 301 redirect from one to the other so they don't appear as different sites to search engines. I also checked some high traffic sites in Google to see how they are indexed, e.g. searching on [site:myspace.com] shows MySpace's domain indexed as www.myspace.com. Since dev411.com was indexed with www. already and responding to both dev411.com and www.dev411.com, I simply added a 301 redirect to www.dev411.com.
The following from the Digital Point thread adds a 301 redirect for Apache:
RewriteEngine on RewriteCond %{HTTP_HOST} ^yoursite.com [NC] RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
However, it seems that many sites do not do a redirect and serve content on both www.domain.com and domain.com. MySpace and Ruby on Rails (rubyonrails.org) are two such sites. Although one is preferred, both are responded to with HTTP 200 status. Perhaps the SEO issue isn't as important of a consideration for those sites.
The other consideration when using cookies. If you wish your users to access your website with no subdomain as well as multiple other subdomains, you will need cookies that can work across both uri styles. To set a cookie that will work without a subdomain, set without the Domain attribute. To set a cookie that will work with multiple subdomains set a cookie with a domain that starts with a dot. To cover both bases, i.e. if you wanted to set session cookies that work across different uri styles, set both cookies with the same name.
Edited 16 June 2007 to discuss non-redirecting sites and cookies.