RewriteEngine on RewriteCond %{HTTP_HOST} ^yoursite\.com RewriteRule (.*) http://www.yoursite.com/$1 [L,R=301]