Folder Content Redirection

How could I concisely redirect all of the pages within a given folder so that every page within it would redirect to its matching filename in the new location?

/folder/example.html redirects to /folder/new/example.html

Also, I have several folders I’d like to do this for, so I’d like to combine them in this statement so that they all are accounted for.

Thanks

RS,

My bad! The redirection is supposed to be a full-blown URL:

Redirect permanent /folder/ http://example.com/new/folder/

Because Redirect is a product of mod_alias (Apache core), it’s MUCH faster (and you don’t need the RewriteEngine on)!

Sorry, “the hurrier I go, the behinder I get!”

Regards,

DK

RS,

Do NOT use mod_rewrite for something this simple. Use

Redirect permanent /folder/ /folder/new

Regards,

DK

What have you tried so far?
If nothing, I recommend you look at our FAQ first. It contains a lot of information and numerous examples on mod_rewrite. You should find what you’re looking for.
If not, feel free to come back with any questions you might have :slight_smile:

Actually, I listed my example wrong, the new folder will precede the old one.

It is not redirecting at all, i removed everything else to eliminate any possible conflict.

Here is what I have in the whole .htaccess file…

RewriteEngine On
Redirect permanent /folder/ /new/folder/