Procedure:
-
Log in to cPanel.
-
Navigate to the document root of the domain and take a backup of all existing data.
-
Delete the domain from cPanel.
-
Recreate the domain with a new document root.
Steps to Create the Domain / Subdomain:
-
Log in to cPanel.
-
Under the Domains section, click Domains.
-
Click on Create A New Domain.
-
Enter the domain or subdomain name in the Domain field.
-
Uncheck the option:
“Share document root (/home/username/public_html) with domain.tld” -
Specify the custom document root directory where you want the files to be stored
(example:/public_html/sub.domain.com). -
Click the Submit button to complete the process.