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