I just did it on my website..
trail.djtrail.nl tester.djtrail.nl etc etc
the rewrite line i used was
RewriteCond %{HTTP_HOST} ([^/]+)\.djtrail\.nl [NC]
RewriteCond %1 !www$ [NC]
RewriteRule ^(.*)$
www.djtrail.nl/%1 [L]
+ the old rewrite line for homepages makes:
RewriteRule ^([^/]+)/?$ index.php?option=com_comprofiler&task=userProfile&user='$1' [L]
for this to work i first had to ditch all my real subdomains (you can have both if you want a headache).. and make *.djtrail.nl go to djtrail.nl via dns settings.