I read somewhere that it hurts your rankings if your domain can be found with AND without the preceding www in the url. So if:
htt://mydomain.com and http://www.mydomain.com both point to your homepage then google might consider this as duplicate content and therefore this could hurt rankings.
To make sure my rankings would remain ok I did the following:
First, I went to google webmaster tools and I configured my preferred domain as being http://www.mydomain.com
Second, I included the following code in my .htaccess file to make sure that any request for htt://mydomain.com would be rewritten as http://www.mydomain.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]
Recently, my rankings dropped dramatically and now I wonder if this has anything to do with the changes above. Anyone who can advice me on this?