The directory of the main domain is the place from which the files are read, which displays the page under the given domain. In the case of cPanel, for additional domains as well as for subdomains, we can change the root directory after the domain has been added. Only for the hosting account main domain we cannot do this, and it is permanently assigned to the public_html directory.
Changing the root directory for addon domain
- Log in to Your cPanel account.
- In the Domains section, select "Additional domains".
- In the secion Modify Addon Domain, click on "pencil" icon.
- In the window that pops up, let's give the new path of the domain root directory.
- Click "Change" to approve the changes
Changing the root directory for subdomain
- Log in to Your cPanel account.
- In the Domains section, choose the "Subdomains" option.
- In the section Modify a Subdomain, click on "pencil" icon.
- In the window that pops up, let's give the new path of the domain root directory.
- Click "Change" to approve the changes