Removing the WWW sub-domain for search engine optimization
One of my websites, Deep Truths would show in a browser using either the WWW subdomain prefix, www.deeptruths.com or without the WWW, e.g. deeptruths.com. From search engines’ point of view, this meant that there were two websites of the exact same content and one of the sites would be penalized and not listed in search results. Deep Truths was hosted on a Microsoft IIS server. Because of this the WWW subdomain name could not be removed without the help of the MS IIS server administrator. He is a friendly guy I’ve had much communication with, but when I wrote him about the problem, he either didn’t understand it well or thought it was not really a problem.
The solution was to move Deep Truths to a Linux Apache server so I could use commands in the .htaccess file to rewrite www.deeptruths.com to simply deeptruths.com MS IIS servers also use .htaccess but the commands to rewrite the URL only work in Linux.
Specifically I added to .htaccess the following lines:
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^www.deeptruths.com [nc]
rewriterule ^(.*)$ http://deeptruths.com/$1 [r=301,nc]
I got this idea from http://www.scribd.com/doc/2300173/Joomla-How-to-Remove-www-from-domain-and-why-it-matters But the example on that page does just the opposite of what it says it is supposed to do, it adds the WWW instead. I’m sure that we a mere typo. I just modified the code moving the www on the other line and it worked. 🙂
All WordPress sites seem to have this feature enabled by default! WordPress seems to be quite good with SEO even though the webmaster doesn’t know much abut SEO.