Did you define it the control panel under the Site Info Manager/Subdomain? Plus make sure this subdomain name is pointing to the webserver. The most common mistake that people do is they manage their own DNS server and when they setup a subdomain name they do not create the A record for the subdomain name in their DNS server.
you have to add the subdomain in your control panel. then, make rewrite rules, because all of those subdomain will just point to the root. apparently, this was my problem months ago, and I get used to it.