The document root is the folder a domain serves files from. Changing it is useful when a framework requires the site to be served from a /public subfolder, or when you want to swap which folder a domain shows.
CHANGING IT
- In cPanel open Domains.
- Click Manage beside the domain.
- Edit the Document Root field to the new path, for example
public_html/newsiteorpublic_html/app/public - Click Update.
The folder must already exist. Create it in File Manager first.
TYPICAL USES
Laravel and similar frameworks: point the document root at the project's /public folder so the application code is not publicly reachable.
Launching a redesign: build the new site in a second folder, test it, then repoint the document root in one step.
Reorganising several sites on one account.
AFTER CHANGING
Clear your browser cache and test in a private window. Check for a leftover .htaccess in the old folder that may interfere. Re-run AutoSSL if the certificate now fails validation.
The primary domain's document root is public_html and cannot always be changed. If the option is unavailable, open a ticket and we will advise on the best structure.