Moving an addon domain to a new document root

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.

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

  1. Open Domains, select Manage beside the intended addon domain and record its current document root.
  2. 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.
  3. Update any absolute filesystem paths in application configuration, cron commands and deployment scripts. Preserve ownership and appropriate permissions.
  4. 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.
  5. 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.

  • 0 Users Found This Useful
  • cpanel-whm, domains-dns
Was this answer helpful?

Related Articles

Adding a domain alias that shares an existing cPanel website

A domain alias serves an existing website under an additional hostname. It is useful for a...

Removing a domain alias from cPanel

Removing an alias stops that hostname being configured as an additional entry to the website on...

Adding a separate website domain in cPanel

Add a separate website domain when another registered name should have its own files rather...

Removing a separate website domain from cPanel

Remove an additional hosted domain when its website is being retired or moved away. Removing...

Redirecting an additional cPanel domain to another website

Use a redirect when visitors to an additional domain should be sent to another URL. A redirect...