how do i create subdomain automatically

Discussion in 'PHP' started by adsegzy, Oct 26, 2010.

  1. #1
    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.
     
    adsegzy, Oct 26, 2010 IP
  2. imperialDirectory

    imperialDirectory Peon

    Messages:
    395
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You just need basic URL rewriting in your PHP code. Then match the subdomain name to a record in database. The only thing you need to be aware of is to make sure wildcard subdomain points to your server and your server can reads the wildcard domain header
     
    imperialDirectory, Oct 26, 2010 IP