Tuesday, April 18, 2017

Website Document Root outside public_html for addon/sub domains

When adding an Addon OR Sub domain, 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 Addon OR sub domain. But, the system WHM 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, login to your server’s WHM as root. Access option Server Configuration >> Tweak Settings. Look for Restrict document roots to public_html 


This setting prevents the creation of addon domains and subdomains outside of a cPanel user's primary domain's document root (the public_html directory within the user's /home directory).

 For example, if you enable this setting and then create the example.com addon domain, the system creates the /home/username/public_html/example.com directory rather than the /home/username/example.com directory.

This setting defaults to On. Turn it off. Now you can make subdomain's document root outside of public_html folder.

No comments:

Post a Comment

Total Pageviews