Situation:
We use "SetEnvIf" in Apache to deny access to our site based on the user-agent. This does not work with LiteSpeed.
For example:
SetEnvIfNoCase User-Agent "^WebZIP" bad_bot
SetEnvIfNoCase User-Agent "^Xaldon WebSpider" bad_bot
deny from env=bad_bot
Is there any way to make this work in LiteSpeed?
Solution:
Just use a rewrite rule for this.
RewriteCond %{HTTP_USER_AGENT} ^(WebZIP|Xadon WebSpider) [NC]
RewriteRule .* - [F]
- Rewrite Rules, User-Agent
- 2 Users Found This Useful