How to map a sub-directory as the root folder in Apache.

If you are still using Apache, time to bust out that .htaccess file.

RewriteEngine On
# Map http://www.example.com to /mynewfolder.
RewriteRule ^$ /mynewfolder/ [L]

# Map http://www.example.com/x to /mynewfolder/x 
# unless there is a x in the web root.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/mynewfolder/
RewriteRule ^(.*)$ /mynewfolder/$1

# Add trailing slash to directories within 'mynewfolder'
# This does not expose the internal URL.
RewriteCond %{SCRIPT_FILENAME} -d
RewriteRule ^mynewfolder/(.*[^/])$ http://www.example.com/$1/ [R=301]

Source