Changing a domain’s document root tells the web server to read files from a different directory. cPanel does not automatically move the existing files when you change this field, so prepare the new location before switching the domain.
IN THIS ARTICLE
Prepare for the change
Back up the application and database, record the old root and check whether other domains share it. This control is not available for every domain type, including the main domain and names sharing its root.
01 Move an addon domain to a new document root
- Open Domains, select Manage beside the intended addon domain and record its current document root.
- Prepare the new permitted folder and copy the application files with hidden configuration files included. Keep private storage outside the public root where the application requires it.
- Update any absolute filesystem paths in application configuration, cron commands and deployment scripts. Preserve ownership and appropriate permissions.
- Enter the new path in the document-root control and save. Follow the panel’s path restrictions rather than assuming any server directory is allowed.
- Test the website over HTTPS, including uploads, administration and scheduled tasks. Keep the old directory intact until the new location is confirmed.
Confirm the expected result
The domain should serve the prepared new directory, while other domains retain their intended content. Compare a distinctive test asset or application path to verify you are not seeing a cached old page.
If the change does not work
If the site fails, restore the recorded root while you correct missing files or path settings. Do not delete the old folder during diagnosis. A PHP-FPM or runtime setting can be influenced by shared roots, so inspect the effective PHP version after the move.
Does moving the root change the domain name?
No. Visitors can continue using the same hostname. This is a server-path change, while renaming a domain or moving DNS changes different parts of the service and requires its own plan.