Normally, the root directory is under public_html where you upload your main site. But in my case since i have multiple sites and to keep my root directory clean as possible. With this technique through .htaccess you may able to redirect your main site to a certain sub folder without showing the sub folder name from the URL bar.
Reminders: If you have your current working site make sure to back up everything before starting.
- (if you have running site) move everything to a sub folder you have created public_html/yoursubfolder
- create .htaccess under public_html
- Then copy the following rules and save.
RewriteEngine On RewriteCond %{THE_REQUEST} /yoursubfolder/([^\s?]*) [NC] RewriteRule ^ %1 [L,NE,R=302] RewriteRule ^((?!yoursubfolder/).*)$ yoursubfolder/$1 [L,NC]