Help Centre Home Web Hosting File Management

How to change the document root for your primary domain name

Last updated: August 19, 2020

cPanel Hosting

On our cPanel hosting services, the primary domain name’s directory will always be public_html/ and this cannot be changed in the Domains section of cPanel (like how you can change this for add-on domains and sub-domains).

However, you can add the following code to your site’s .htaccess file to nominate a different folder for your site to load from.

PLEASE NOTE: This method is for advanced users and is not recommended if you are not familiar with modifying your website’s .htaccess file.

# START Change Document Root
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomaingoeshere.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.yourdomaingoeshere.com$
RewriteCond %{REQUEST_URI} !nominatedfoldername/
RewriteRule (.*) /nominatedfoldername/$1 [L]
# END Change Document Root

In this example, change yourdomaingoeshere.com to your website’s domain name, and nominatedfoldername to your website’s nominated document root path.

WordPress Hosting (Plesk)

  1. Log in to your Plesk service.
  2. Navigate to Websites & Domains.
  3. Click on Hosting Settings near the top of this page under your domain name.
  4. Type in the path to your new document root.
  5. Scroll to the bottom and click OK or Apply.

That’s it! The Plesk interface allows the document root to be modified much easier.

Still need a bit of help?
Contact our
Sales team
Shoot our friendly team an email. You should expect a response within an hour!
Email Sales
Submit
a ticket
Login to MyZuver and start a new eTicket with one of our helpful departments.
Log Into MyZuver