The document root is the folder a domain serves its website from.
Addon domains and subdomains
- In cPanel, open Domains.
- Click Manage beside the domain.
- Change the New Document Root and click Update.
Your main domain (public_html)
The main domain always uses public_html. To serve it from a subfolder (for example public_html/site), add this to public_html/.htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?yourdomain\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/site/
RewriteRule ^(.*)$ /site/$1 [L]
Frameworks such as Laravel that need a public folder as the root can use the same approach. Test carefully after making changes.