How to redirect main domain to subfolder

You need to add below code in the .htaccess file in the public_html folder of your hosting account. If.htaccess page is not exist then you can create it from cpanel under public_html directory.

#rdpsupport.com
#Replace rdpsupport.com with your domain
#Change 'rdp' to be the directory you will use for your main domain
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?rdpsupport.com$ 
RewriteCond %{REQUEST_URI} !^/rdp/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /rdp/$1 
RewriteCond %{HTTP_HOST} ^(www.)?rdpsupport.com$ 
RewriteRule ^(/)?$ rdp/index.php [L]

You may also like...