Forum Moderators: coopster
I never got very comfortable with the .htaccess file but, as I said, there are plenty of existing resources in the apache forum as well as a very capable moderator who very generously helps with these problems in the case that they haven't been answered yet.
Now anything.domain.com will resolve to the same site as domain.com. U can then use the SERVER_NAME or similar environment variables to discover which subdomain has been called in your script. Don't forget to return proper 404 or 301 codes for the subdomains you don't use.
SN