How To Change Document Root Using .htaccess File
When you establish an account on a shared or reseller server, the website loads from the public_html directory by default. Either this directory or the web directory serves as the document root. What happens if you want the content of your website to load from a subdirectory or another directory?
All you have to do is add the following code to the account’s.htaccess file. The.htaccess file can be created with cPanel’s File Manager. The URL will reroute to the subdirectory upon accessing your domain.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteCond %{REQUEST_URI} !web/
RewriteRule (.*) /web/$1 [L]
Make sure you replace domain.com with your actual domain name & web with your actual sub folder.
Read More:How to Add, Edit and Delete Cron Jobs in cPanel
Read More:How to Reset Email Account Password from cPanel
Read More:How to Check the Commission Status from hostvento Affiliate Dashboard