Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

In my .htaccess file, I'm currently using RewriteCond to match the user agent of bad bots.

I know that SetEnvIf can also be used to block bad bots too.

The question is, what's the difference between RewriteCond and SetEnvIf?

Is one better than the other when it comes to server performance?


share|improve this question
up vote 1 down vote accepted

RewriteCond is part of mod_rewrite and this is really resources intensive module, so if you can do what you need without it, SetEnvIf or otherwise i would say it's much better.

share|improve this answer

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.