Use htaccess to Rewrite Folder Structure

*geek alert*

I spent a long time trying to figure out this solution, so I wanted to share it here to possibly help someone else. If you are looking to redirect an existing path on your site, like:

www.mysite.com/old/folders/content
to something like:
www.mysite.com/new/directory/content

Add this (and tweek to your needs) to your .htaccess file on the root of your website.

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^old/folders(.*)$ http://www.mysite.com/new/directory$1 [L,R=301]

— December 30th, 2008

Comments are closed.