Building a subdomain outside public_html in cPanel offers enhanced security, organization, and flexibility for isolating sensitive content, testing new features, hosting multiple websites, and managing complex file structures.
Let us follow some simple steps:
- Log in to WHM.
- Select the “Server Configuration” category and click on the “Tweak Settings” sub-options.
- You will enter a new page with multiple tabs.
- Under the “All” section, you can search “public_html” using the search box.
- You will find the option “Restrict document roots to public_html [?]”. This is usually “On”; switch it to “Off”.
- It stops users from creating subdomains outside their public html directory when set to “On”.
- Click on the “Save” button.
You can construct a subdomain outside public_html in cPanel, and should you encounter any difficulties, please do not hesitate to contact our support team.
If you’re using Plesk, you might find our guide on How to Create Subdomains in Plesk Control Panel