Forum Moderators: phranque
ServerAlias *.mydomain.com
takes care of that. I have Wildcard DNS, too.
In the section where I do the URL rewriting to make subdomains work nicely, this one:
RewriteCond %{HTTP_HOST}!^www\.mydomain\.com [NC]
excludes www.mydomain.com from URL rewriting
HTH - it worked for me