How To Change Primary Domain Document Root In cPanel?

What is the Domain Document Root Folder?

The document root is a folder where the website files are placed for the domain. A cPanel account is created using the main domain. All main domains of the hosting account use the public_html directory for its website files and data. The sub-directories inside the public_html directory are used by the addon domains. The main domain can also be set up to use a sub-directory inside the public_html directory instead of public_html itself. This is called as change primary domain document root.

Follow the below steps to change primary domain document root in the cPanel account.

  1. Login to your cPanel account.
  2. Under the Domains section, click Domains.
    cpanel domain
  3. On the new page, click the Manage button against the domain you want to change the root directory.
    cpanel domain manage
  4. You will be redirected to the new page. Under the section, New Document Root provides the new path for your domain.
    cpanel domain new path
  5. Click the Update button to set the new path for the domain root directory.
    cpanel update new path

That’s It! Change primary domain document root is done and should go into effect immediately.

Note: We encourage you to create a backup of the addon or subdomain’s contents in the event a restore is required

Also, you should manually move the site’s contents into the new document root. This change only lets Apache know where to search the domain’s contents.

If you enjoyed this tutorial, then you would love our support! All Kemuhost hosting plans include 24/7 support from our amazing support team. Check out our web hosting plans and have your website migrated for free today!

Add a Comment

Your email address will not be published. Required fields are marked *