Black Friday Hosting Deals: 69% Off + Free Migration: Grab the Deal Grab It Now!
To set the document root outside the public_html folder for an addon domain or subdomain, follow these steps based on the control panel you're using:
Log in to your cPanel account.
Navigate to Addon Domains or Subdomains:
For an addon domain: Go to Domains > Addon Domains.
For a subdomain: Go to Domains > Subdomains.
Create a New Domain or Edit the Existing One:
If you're creating a new domain or subdomain, fill out the necessary fields. In the "Document Root" field, you can specify any directory path outside public_html (e.g., /home/username/addon-domain).
If you want to change the document root for an existing domain, find the domain in the list and click Edit to change the document root.
Set the Document Root:
Change the document root to a path outside public_html, such as /home/username/addon-domain.
Save Changes: After editing, save the settings, and the new document root will be applied.
Log in to your Plesk dashboard.
Navigate to Domains:
Go to Websites & Domains and click on the domain or subdomain you wish to modify.
Change Document Root:
Select the domain or subdomain and click on Hosting Settings.
In the Document Root section, you can specify the path where you want to set the root. You can place it outside the default directory, for example, /var/www/vhosts/domain.com/new-folder.
Apply Changes: Click OK or Apply to save the new document root location.
If your control panel doesn’t support setting the document root easily:
Access your server via FTP or File Manager.
Move the files:
Move the contents of the addon domain or subdomain to the new location outside public_html.
Edit Apache or Nginx Configuration (if necessary):
Update the virtual host configuration (httpd.conf or .htaccess for Apache, nginx.conf for Nginx) to point to the new document root. This may require root access to the server.
Let me know which method you're using, and I can provide further specific guidance.
Let’s talk about the future, and make it happen!
By continuing to use and navigate this website, you are agreeing to the use of cookies.
Find out more