This will work
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domainname.com
RewriteCond %{HTTP_HOST} ([^.]+)\.domainname.com
RewriteRule ^(.*) user/user.php?username=%1
ErrorDocument 404 /notfound.php
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*