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.
Other than that, you're usually better off keeping the document root for an addon domain set. Changing the document root for an addon domain at times may break the site as the hard links and paths declared within the web application or database may no longer exist. In such a scenario, consulting a systems administrator or developer may be beneficial.
As with everything, we encourage you to create a backup of the addon domain's contents in the event a restore is required. Instructions regarding this can be found below:
Once that's out of the way, we can get started.
- Log in to the cPanel account the addon domain is located in.
- Access the "Addon Domains" interface.
- Locate the Addon Domain to change the document root for under "Modify Addon Domain".
- Click on the pencil icon next to the path, under the "Document Root" column.
- Enter the new document root for the addon domain, and click "Change".
These changes should go into effect immediately.
NOTE: You will still have to manually move the site's contents into the new document root. This change only lets Apache knows where to look for the domain's contents.