this is what i used
Code: 
##Redirect non-www to www:
#RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
#RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]