I am looking to create a system which on signup will create a subdomain on my website for the users account area.
e.g. johndoe.website.com
I think it would
The easiest way is to redirect all subdomains (with wildcard *) to point to your /wwwroot. Then put .htaccess to this folder with the following code:
RewriteCond %{ENV:REDIRECT_SUBDOMAIN} =""
RewriteCond %{HTTP_HOST} ^([a-z0-9][-a-z0-9]+)\.domain\.com\.?(:80)?$ [NC]
RewriteCond %{DOCUMENT_ROOT}/%1 -d
RewriteRule ^(.*) %1/$1 [E=SUBDOMAIN:%1,L]
RewriteRule ^ - [E=SUBDOMAIN:%{ENV:REDIRECT_SUBDOMAIN},L]
This will accomplish that every subfolder of the /wwwroot folder in acceptable via subdomain (foldername.domain.com).
Found this years ago on http://www.webmasterworld.com/apache/3163397.htm