Knowledgebase:
How To Redirect Your Domain To A Subfolder Using .htaccess
Posted by Support, Last modified by Support on 05 December 2012 12:54 PM
Here is a simple way to redirect your primary domain to a subfolder on that domain. For the purposes of this tutorial it will redirect to a subfolder at /blog. This is useful if your WordPress blog is installed to a subfolder and you want the main domain to forward to it.

In your html folder (also called the “root html” folder), you need to edit a file called .htaccess. From this file we are going to use a few lines to redirect those requests in a search engine friendly way.

Add the following lines to that file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.com$
RewriteRule ^(/)?$ blog [L]

Or another way is to add the following lines:
RewriteEngine On
RewriteRule !^blog/ /blog%{REQUEST_URI} [L,R=301]

The only change you need to make is to change “YourDomain.com” to your domain. This will then redirect everything from the domain to the folder /blog at that domain. If you want to change that folder just edit the “blog” part.
(12 vote(s))
Helpful
Not helpful