#Grab the subdomain from the domain
RewriteCond %{HTTP_HOST} ^([^.]+).DOMAIN.COM$
#Make sure the subdomain is not www or example
RewriteCond %{1} !^(www|example)$
#Check if the directory actually exists before we go there
RewriteCond /home/USER/public_html/%1 -d
#This stops it from looping
RewriteCond %{REQUEST_FILENAME} !^/home/USER/public_html/
#Finally, this is the actual rewrite
RewriteRule (.*) /home/USER/public_html/%1/$1 [Last]
Change the DOMAIN.COM WITH YOUR OWN DOMAIN AND USER WITH YOUR USER NAME