开发者

Difference between Apache rules to block libwww-perl [closed]

开发者 https://www.devze.com 2023-04-06 13:39 出处:网络
Closed. This question is off-topic. It is not currently accepting answers. 开发者_开发百科 Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed. This question is off-topic. It is not currently accepting answers.
开发者_开发百科

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 10 years ago.

Improve this question

I want to know the difference between these rules and which is most effective to block libwww-perl with the file .htaccess

SetEnvIfNoCase User-Agent "libwww-perl" bad_bot
Order Deny,Allow
Deny from env=bad_bot

or

RewriteCond %{HTTP_USER_AGENT} libwww-perl.* 
RewriteRule .* – [F,L]

Thank you!


Functionally, I think they are much the same, with some minor pros and cons. However the former is probably more portable, since you won't have worry about mod_rewrite being installed on the server should you move the site at some point in the future.

Naturally, if you have other mod_rewrite rules this won't make much difference to you.

You also have a wildcard set up in the mod_rewrite rule, that isn't present in SetEnvIfNoCase. I understand this is possible to do this there also, and it might be wise to do so, since you can then catch different libwww versions.

I'm sure you know libwww-perl can send an arbitrary user agent string, so neither will stop the determined.

0

精彩评论

暂无评论...
验证码 换一张
取 消