Automatically creating a subdomain with CPanel, without logging into CPanel

avandam

Registered
Jun 13, 2005
2
0
151
South Africa
Good morning,

My hosting provider uses CPanel to help me manage my domain. They do not provide SSH or anything like that and I have to login to CPanel to create sub domains.

A client of mine wishes to create a new sub domain every time they create a new section on their website. We have developed a content management system for them which allow them to create the new section and add all the information for that section. This then sends me an email telling me to create the appropriate sub domain.

I want to automate this process. Basically when they create the new section I want to use a PHP script to tell CPanel to create the new sub domain and redirect it to the correct page.

For example: They create a new section called support which requires a sub domain like support.mydomain.com. The actual page called is something like index.php?section=23. I now want to tell CPanel to create a sub domain called support.mydomain.com and redirect all requests to http://www.mydomain.com/index.php?section=23.

I have done a bit of Googling, with possibly the wrong search terms, which didn't bring any clarity.

It will be much appreciated if you could provide me with some additional information and/or pointers on how to get this going.

Thanks in advance

Albert