Page 1 of 1

how do i create subdomain automatically

Posted: Mon Nov 01, 2010 8:30 am
by adsegzy
Hello friends,
i want a situation whereby when members confirm his registration a subdomain will be automatically created. eg if a member by name Mike Lawrence confirm his registration, a subdomain like www.mydomain.com/mikelawnrece OR mikelawrence.mydomain.com will be created, so that anyone can visit his profile by entering the subdomain in any address bar. pls what are the easiest ways of doing this.

Re: how do i create subdomain automatically

Posted: Mon Nov 01, 2010 10:51 am
by pickle
Your best bet would be to set up a *.yourdomain.com subdomain, and have it forward to your regular www.yourdomain.com website. In your index.php file, check what the subdomain is & show the appropriate stuff based on that.

Re: how do i create subdomain automatically

Posted: Mon Nov 01, 2010 11:56 am
by adsegzy
Pls do you have any tutorial for that, i need one to put me through. thanks

Re: how do i create subdomain automatically

Posted: Tue Nov 02, 2010 9:51 am
by pickle
I think CPanel is the easiest way to set up a subdomain. If you don't have access to that, talk to your hosting provider & tell them what you want to do.

As far as examining the url in PHP, look into the $_SERVER superglobal.