I got this email from one of the php usergroups,
â€œI have to create subdomains dynamically by php when an user registered in my site. Anybody who knows the script and procedure , please send me ASAP.â€
I hate repeating things so better let it go live than bury inside a usergroup. Here I go with the answer.
Step 1: Make the following entry to your apache http.conf
ServerAlias *.domain.com ( do not forget to restart apache 🙂 )
Step 2: Now remember that all the query comes to same doc root. Now you need to catch it using .htaccess and process it the way you want.
Also make sure your dns is able to process your sub-domains properly. These simple steps will make it happen.