RewriteEngine on
RewriteCond %{HTTP_HOST} ^domainname.com
RewriteRule ^(.*)$ http://www.domainname/$1