Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

Thanks!

share|improve this question

1 Answer 1

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

 
discard

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.