In your Wordpress settings make sure you have the
http://www.yourdomain.com
Then go into your Webmaster tools settings and check the option that says always use
http://www.yourdomain.com
Then add this to your .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]