Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation



integrationblogcta.jpg

SubDomain Module Documentation

This module allows users to control their subdomains.

The functions within this module may or may not be governed by a feature list. The required feature list may vary from function to function, to review a total list of the available features sets on a cPanel server, please see "Feature Manager" in WHM.

SubDomain::listsubdomainsop

API Version: 1 - Click here for documentation
Syntax: SubDomain::listsubdomainsop( )
Description: Retrieve a list of subdomains associated with the cPanel account, enclosed in
Returns:  
 
<option value="sub1">sub1.example.com<option>
<option value="sub2">sub2.example.com<option>
<option value="sub3">sub3.example.com<option>

SubDomain::addsubdomain

API Version: 1 - Click here for documentation
Syntax: SubDomain::addsubdomain( domain, rootdomain, usecanonicalname, disallowdot, dir )
Description: Add a subdomain.
Parameters:  
  domain (string)
  The local part of the subdomain to add (e.g., sub if the subdomain was sub.example.com). This value should not contain the domain with which the subdomain is associated.
  rootdomain (string)
  The domain to which to add the subdomain (e.g., example.com).
  usecanonicalname (boolean (optional))
  Set this parameter to 1 when adding a wild card subdomain.
  disallowdot (boolean (optional))
  If this parameter is set to 1, the function will automatically strip dots from the $domain value.
  dir (string (optional))
  The subdomain's document root within the account's home directory. This value defaults to a directory of the same name as the subdomain in the public_html directory (e.g., public_html/subdomain/ if the domain's name was subdomain.example.com).
Returns:  
 
This function does not produce any output.

SubDomain::cplistsubdomains

API Version: 1 - Click here for documentation
Syntax: SubDomain::cplistsubdomains( )
Description: Retrieve a list of subdomains associated with the cPanel account. Each subdomain is separated by a line break.
Returns:  
 
sub1.example.com<br>
sub2.example.com<br>
sub3.example.com<br>

SubDomain::disablesubrd

API Version: 1 - Click here for documentation
Syntax: SubDomain::disablesubrd( sub )
Description: Disable a subdomain's redirect.
Parameters:  
  sub (string)
  The subdomain for which to disable the redirect. This parameter can take a literal subdomain (e.g., sub) or a full subdomain name (e.g., subomdain.example.com).
Returns:  
 
The output should resemble the following:
<b>Redirection has been disabled on $subdomain.</b>

SubDomain::setsuburl

API Version: 1 - Click here for documentation
Syntax: SubDomain::setsuburl( sub, url )
Description: Redirect a subdomain to a specific URL.
Parameters:  
  sub (string)
  The subdomain to redirect.
  url (string)
  The URL to which to redirect.
Returns:  
 
This function does not produce any output.

Topic revision: r2 - 29 Mar 2012 - 15:28:13 - Main.JenniferDoubrava