I have several old, broken urls that looked like this: http://www.easyjob.net/partners/whatever.html

I would like to redirect them all to http://www.easyjob.net/partners/general/

The following rule won't work, as the "destination" url will trigger the same rule again, and I'll get a "too many redirects" error.

How can I match any html file inside the /partners/ folder but without matching anything in the /partners/general/ subfolder?


  • 1
    You forgot to include your current rule. Did you use the L flag ?
    – pritaeas
    Aug 24 '11 at 8:30

Try something like this:

RewriteCond %{REQUEST_URI} !partners/general/(.*)?
RewriteRule partners/(.*) http://www.easyjob.net/partners/general/ [R=301]

You may need to tweak the RewriteCond to meet the exact exclusion you're looking for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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