Introduction
Changing the document root for an addon domain or subdomain on an account is possible. However, cPanel does not currently have a feature to change the document root of the primary domain. To work around this limitation, you must change the primary domain on the account to a placeholder domain, then add the previous domain as an addon domain.
Procedure
Please note that before making any account modification, you should create a backup of the account.
How to generate a backup of my entire cPanel account
- Log into the user's cPanel account.
- Remove any subdomain or addon domain.
- Log out of the user's cPanel account.
- Login to WHM as the 'root' user.
- Navigate to "Home / Account Functions / Modify an Account."
- Select the user to modify.
- Click the "Modify" button.
- Change the primary domain to a placeholder domain, such as
placeholder01.tld
. - Click the "Save" button at the bottom of the page.
- Log back into the user's cPanel account.
- Add the previous domain as an addon domain with the desired document root.
- Add any previously removed subdomains or addon domains back to the account.