M3Server Technical Blog FAQ Redirect old directory to new directory

Redirect old directory to new directory



A simple htaccess modification can solve a web site change for you. If you want to create a new directory for whatever reason and redirect the old directory to the new one, this will get it done:


## /testa/ to /testb/
RewriteEngine on
RewriteRule ^testa/(.*)$ testb/$1 [R,L]

This will rewrite the directory and all the files in the directory as well.

Live example usage:

https://dontdevonlivesitesyabonehead.blog.m3server.com/testa/sample.text
https://dontdevonlivesitesyabonehead.blog.m3server.com/testa

Leave a Reply