How can I change the document root for an Addon Domain or Subdomain? Print

  • 0

Introduction

Before getting started, it's important to note that there's no real benefit in adjusting a pre-existing addon domain's document root. Unless the change is strictly for visual purposes or to cater to a development request.

Otherwise, you're better off keeping the document root for the domain set. Changing the document root for an addon or subdomain may sometimes break the site as the hard links and paths declared within the web application or database may no longer exist. Consulting a systems administrator or developer may be beneficial in such a scenario.

 

Procedure

Please note that we encourage you to create a backup of the addon or subdomain's contents in the event a restore is required. Instructions regarding this can be found below:

How-To Manually Transport Backups to Remote Backup Destination

Once that's complete, you can proceed with the following steps.

  1. Log in to the cPanel account the addon or sub-domain is located.
  2. Access the "Home / Domains / Domains" interface in cPanel
  3. Locate the domain to change the document root and select "Manage."
  4. Change the document root under "New Document Root."
  5. Click "Update"

These changes should go into effect immediately

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


Was this answer helpful?

« Back