Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using the Redirection plugin and I would like to use it to redirect my old static html pages to the new Wordpress pages. So basically anything that looks like becomes

The only catch is that I want to exclude a folder so anything that is shall remain untouched.

share|improve this question
Do you want to exclude one folder? Or all folders? If it's all folders, this should work: RedirectMatch 301 ^/([^/]+)\.html$$1 –  Joost de Valk Sep 28 '11 at 13:43
no I want to exclude 1 folder (and its sub folders). Thanks for your help (and plugins!) –  Matthew Xerri Sep 28 '11 at 13:45

1 Answer 1

Let's see, this should do the trick then:

RewriteCond %{REQUEST_URI} \.html$
RewriteCond %{REQUEST_URI} !^/specialfolder/
RewriteRule (.*)\.html$1 [R=301,L]
share|improve this answer
Thanks Joost it worked! I will still try to implement the same rule for . Tried a lot but so far only you solution worked. Note that I changed the last line to RewriteRule (.*)\.html$1 [R=301,L] and that I added the rule just after RewriteBase / –  Matthew Xerri Sep 28 '11 at 14:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.