Use .htaccess to redirect root of the website to subfolder

Use .htaccess to redirect root of the website to subfolder

Sometimes a redirect from the root of the website to the subfolder is needed. The .htaccess rules below achieve just that.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^$ /subfolder [R]

Leave a Reply