WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 http://www.example.com/page.html becomes http://www.example.com/page/

The only catch is that I want to exclude a folder so anything that is http://www.example.com/specialfolder/page.html 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$ example.com/$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

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

RewriteCond %{REQUEST_URI} \.html$
RewriteCond %{REQUEST_URI} !^/specialfolder/
RewriteRule (.*)\.html http://www.example.com$1 [R=301,L]
share|improve this answer
Thanks Joost it worked! I will still try to implement the same rule for wordpress.org/extend/plugins/redirection . Tried a lot but so far only you solution worked. Note that I changed the last line to RewriteRule (.*)\.html example.com/$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.