Most of the SaaS companies, some social networking, and blog services (like Wordpress.com and blogger) create a personalized sub-domain for each user, e.g. username.website.com
What is the general practice for doing this. Do most of them really create a sub-domain or do they add some kind of URL redirects/routes for achieving this (assume Apache with mod_rewrite support).