Domain
Rename a primary, addon, or alias domain
This function renames a primary domain, addon domain, or alias domain on a cPanel account. The system updates all relevant configuration files, document root paths, and DNS entries automatically.
Note:
- You cannot rename a domain while another rename operation is in progress.
- You cannot rename the server hostname.
- The new domain must not already be configured on the account.
post/Domain/rename_domain
Query parameters
domainstring domain required
Example:old.example.com
The current domain name to rename.
new_domainstring domain required
Example:new.example.com
The new domain name.
docrootstring
Example:new.example.com
The path to the domain's document root directory. If you do not specify a value, this parameter defaults to the new domain name.
Response
Request was successful.
Example response
{
"apiversion": 3,
"func": "rename_domain",
"module": "Domain",
"result": {
"data": {
"message": "Domain old.example.com successfully renamed to new.example.com"
},
"status": 1
}
}