Domains and DNS
Change the path of an additional domain
Each additional domain with its own folder serves the files in its document root. Changing that path makes the server look for the website there; cPanel doesn't move the files or adapt the application.
Prepare the change
Note down the current path and make a restorable backup of the files and databases. Prepare the new folder and check that it doesn't contain another website. If the application receives orders, comments or files, plan maintenance so writes don't end up split between two locations.
Choose the new root
- Open cPanel and go to Domains.
- Click Manage next to the right domain.
- Change New Document Root and check the resulting path.
- Confirm with Update once the files are ready.
This option doesn't let you change the root of the main domain or of an alias that shares its folder. Some configurations restrict paths to public_html; use the locations your panel allows.
You can prepare the files with the File Manager. Keep hidden files such as .htaccess, and check references to absolute paths, cron jobs and upload directories.
Check or roll back
Test the home page, an internal page, images, forms and admin access. Check for errors and permissions. The public domain hasn't changed, so you shouldn't replace its URLs in the database just because you moved the folder.
If it fails, restore the previous root and the related configuration, bearing in mind any data received during the change. Don't delete the old copy until you've checked the new location and kept a separate backup.
You may also find useful
- Host the account's main domain in a subdirectory Provides .htaccess rules to serve the main website from a subfolder and keep an account that hosts s...
- My registered domain doesn't appear in cPanel: how to add it Tells the domain registration apart from its configuration in the hosting and explains how to add it...
- Connect a Hostsuar domain to Shopify Explains which DNS records to connect to Shopify, where to edit them depending on the nameservers, h...
- Connect a Hostsuar domain to Webflow Guides you through connecting manually to Webflow using the project's current values, the authoritat...
Something wrong or out of date? Tell us and we will review it.