Document Root Changes
Updating the document root folder for a domain name changes the actual location of a site's files. Your primary domain uses the public_html folder by default.
Change Document Root for an Addon or Subdomain
By default, addon domains and subdomains use folders beneath the public_html folder - thus, the root directory for an addon domain named somedomain.com would by default be public_html/somedomain.com.
To change the document root folder:
Log in to cPanel.
- In the Domains section, click the Addon Domains or Subdomains icon, depending on which you'd like to modify.
Locate the addon domain (or subdomain) you wish to modify.
- Click the pencil icon next to the current document root for the domain you wish to modify.
Example for Addon Domain:
Example for Subdomain:
- In the pop-up window, enter the new document root and click Change.
Alternatives to Changing the Document Root for the Primary Domain
If you still want your primary domain to use a root folder other than public_html, you have two options:
- Change the primary domain name on your account, then add the old primary domain as an addon domain. This way, you can pick the root folder you want for the primary domain/new addon domain. (The new primary domain will now point to public_html.)
- Use mod rewrite to automatically redirect your website visitors to a new default directory. The new folder name will appear in the URL (i.e., http://domainname.com/subfolder/).