To change root URL main domain to subfolder we can use .htaccess

Your main domain will use the public_html directory for all of its Web site files by default. Addon domains use subdirectories inside the public_html directory.

In order to also set up your main domain to use a subdirectory on your hosting account, you will need to set up a redirect in the .htaccess file in the public_html folder so that the server knows that any request for your main domain will be redirected to a subdirectory on public_html.


RewriteEngine on

RewriteCond %{HTTP_HOST} ^(www.)?$

RewriteCond %{REQUEST_URI} !^/subdirectory/

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ /subdirectory/$1

RewriteCond %{HTTP_HOST} ^(www.)?$

RewriteRule ^(/)?$ subdirectory/index.html [L]

Source: BlueHost