Use htaccess to redirect blog posts from Subfolder to Root

A simple trick to redirect all your content automatically from a subfolder on your website / blog to the root folder. Simply create a new .htaccess file within the sub-directory and save.

RewriteEngine On
RewriteRule ^(.*)$ /$1 [R=301,L]

With the above lines included in a file named .htaccess in the subfolder, everything in /subfolder redirects to /. Hope this simple trick has helped you automatically redirect all the content on your blog which was moved from a subfolder to the root folder. Also note that the search engine juice and backlinks to the subfolder will be carried forward to the root by using this method.