This guide is exclusively for those who have cPanel as control panel of hosting server. cPanel is the most popular control panel used by hosting service providers. It deals with how someone can move addon domain outside public_html folder so that it gets easy to find and manage intended domain easily.
Step by Step Guide to Move Addon Domain Outside public_html Folder
If you want to host other than primary domain on the same server, you must add it as an Addon Domain. This is possible only if the hosting package is for multiple domains.
The Addon Domain added so will automatically get inside public_html/addondomain.com folder. In such case if someone goes to maindomain.com/addondomain1.com, this will access your addon domain site.
In new cPanel, you may also find the addon domains are parked outside the public_html folder.
Also, if you have multiple addon domains, the public_html folder where your main domain lies gets messy.
Therefore, you may be willing to move addon domain outside public_html folder on cPanel.
So, is it possible to move addon domain outside public_html folder on cPanel?
The answer is simply yes. cPanel has made it possible to move addon domain to park outside public_html folder.
You can move your addon domain outside public_html folder following the below mentioned simple step by step guides.
1. Login to cPanel
Login to cPanel with method provided by hosting service provider or by going to yourdomain.com/cpanel [ your domain refers to any domain hosted to the same cPanel ]
2. Go to Domain or Addon Domain
After you are logged into your cPanel, click on Domain or Addon Domain available in cPanel home.
Here, you will see the main domain as well as all the addon domains you have added on the server.
3. Check Compatibility
There is no criteria for eligibility. It may depend upon hosting service providers configuration or due to old (not updated) cPanel installed on their server.
To check if it is possible to move addon domain outside public_html folder, click on the Manage button of any addon domain.
If the public_html is not editable/deletable as shown in the first picture, you won’t be able to move addon domain outside public_html folder.
If it is editable as shown in the second image, then proceed the further steps described below. Please keep this window open.
4. Backup Addon Domain Directory in Local Disk
Before making any major changes, it is good to make a backup files and save it on local storage.
Therefore, go to public_html, choose an addon domain you want to move outside public_html folder.
Compress the whole folder into zip, and download the individual zipped files of all the addon domains you are willing to move outside public_html.
5. Copy Files (Folder)
Select the addon domain(s) that you want to move outside public_html folder. Right click and select copy option.
Then clear “/public_html/” and click on copy files. To avoid few minutes of down time, do not move the files now.
6. Update the Domain Document Root
Go to the window you opened in step 3. Erase “/public_html/” text from the box. At this step, it should look like the following image.
Then click on update button. At this stage, the process has already completed. Also the site was not affected even for a second as the same files were available in both locations.
Note: Folder name copied under step 5 should match with New Document Root name under step 6.
For example, if I change the folder name under 5 into ‘abc’, the document root under 6 should also be ‘abc’.
7. Delete Files After You Move Addon Domain Outside Public_html
Now, you can delete the addon domain folders located inside public_html. You should do it to free up your space as well as reduce messy files and folders.
So, what is the point of backup saved on local storage?
– This was just a precaution to avoide loss due to any misconfiguration caused by mistake. If your site (addon domain) started working after being outside public_html folder, then you can also delete the backup files from your local storage.
You can move addon domain outside public_html folder on cPanel easily. But you must pass the eligibility criteria mentioned in above points.
In simple words, you must have a new version of cPanel.
To do so, you will need to:
- create a backup of your files
- change the document root of addon domain to home directory
- move the related addon domain folder to home directory.
- delete the backup files after successfully completing the process
Learn to install WordPress manually without Softaculous.