免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4900 | 回复: 3
打印 上一主题 下一主题

[Web] apache如何拒绝掉某个User-Agent的链接请求 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-01-22 10:31 |只看该作者 |倒序浏览
5可用积分
rt,最近为了给自己方便在web服务器上放了一个iso,结果今天发现有很多Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)这样的user-agent来下载这个文件,虽然我已经删掉了这个iso,但是请求还是不断,所以想直接禁止他访问,请问如何配置?谢谢

论坛徽章:
0
2 [报告]
发表于 2009-01-22 10:37 |只看该作者
Example:

To rewrite the Homepage of a site according to the ``User-Agent:'' header of the request, you can use the following:
RewriteCond  %{HTTP_USER_AGENT}  ^Mozilla.*
RewriteRule  ^/$                 /homepage.max.html  [L]

RewriteCond  %{HTTP_USER_AGENT}  ^Lynx.*
RewriteRule  ^/$                 /homepage.min.html  [L]

RewriteRule  ^/$                 /homepage.std.html  [L]
Interpretation: If you use Netscape Navigator as your browser (which identifies itself as 'Mozilla'), then you get the max homepage, which includes Frames, etc. If you use the Lynx browser (which is Terminal-based), then you get the min homepage, which contains no images, no tables, etc. If you use any other browser you get the standard homepage.


http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

参考

论坛徽章:
0
3 [报告]
发表于 2011-02-27 13:27 |只看该作者
不错,学习了,iis的怎么设置呢。

论坛徽章:
0
4 [报告]
发表于 2011-02-27 15:31 |只看该作者
不建议这么做,这个agent貌似是windows xp上的ie6发过来的,如果禁掉会导致大量用户无法访问。。。
既然已经删掉了,就不用管他了,实在不放心的话就看看你的网站还有没有指向这个iso的链接。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP