Create subdomain
This function creates a subdomain.
Important:
When you disable the Web Server role, the system disables this function.
Query parameters
The subdomain name to create.
The domain on which to create the new subdomain. The domain must already exist on the cPanel account.
Whether to use a canonical name (CNAME) in the Apache® configuration for self-referential URLs.
- 1 - Use the CNAME.
- 0 - Do not use the CNAME.
The subdomain's document root within the home directory, given as a valid directory path relative to the user's home directory.
This value defaults to the user's home directory /public_html/ path.
Note:
If the Restrict document roots to public_html value is set to Off in WHM's Tweak Settings interface (WHM >> Home >> Server Configuration >> Tweak Settings), this parameter defaults to the /username/ path. For example, the username user's subdomain example would default to the /home/username/example path.
Whether to remove the dot (.) characters from the domain value.
- 1 - Remove dots from the domain.
- 0 - Do not remove dots from the domain.
Response
HTTP Request was successful.
Example response
{
"apiversion": 3,
"func": "addsubdomain",
"module": "SubDomain",
"result": {
"status": 1
}
}