Watch this video for a step by step process on how to set document root outside public_html for addon domain or sub domain
When adding an Addon OR Subdomain, the default DocumentRoot on cPanel servers is /home/user/public_html/addon.com. What if you want to set the DocumentRoot outside public_html? You can when adding the Addon OR subdomain. But, the system won’t allow it. To enable this feature, you need to contact your web hosting provider. Not all web hosts provide this feature. If you have a VPS hosting OR dedicated server, then
- Log in to WHM as root.
- Click on Server Configuration.
- Go to Tweak Settings.
- Now, in the Find textbox type public_html.
- By default Restrict document roots to public_html option is On. Set it to Off.
- When set to On it prevents users from creating subdomains outside of their public_html directory.
- Click on Save.
This will allow you to set document root outside public_html for the Addon Domain or Subdomain.
This feature is available with our cPanel shared hosting plans.