I have a need to mod-rewrite my domain based off of subdomains...there are two scenarios in which i would need to do this:
my site is located in different cities...so losangeles.example.com should localized to los angeles, etc...essentially rewritten to www.example.com/?loc=losangeles
i want to allow users to create username.example.com to pass their profiles to friends with ease...essentially rewritten to www.example.com/user.php?id=username
As my site scales, I plan on having over 300 locations, and several thousand users...which means that hand coding each rewrite rule would be a little tedious.
How can I tell mod-rewrite to decipher between a location subdomain and a username subdomain?