如何允许扫描asp.net网站称为网络爬虫和块垃圾邮件和有害的机器人 [英] how to allow known web crawlers and block spammers and harmful robots from scanning asp.net website

查看:184
本文介绍了如何允许扫描asp.net网站称为网络爬虫和块垃圾邮件和有害的机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我该如何配置我的网站允许来自知名爬行机器人
像谷歌,必应,雅虎,Alexa的等,并停止其他有害垃圾邮件发送者,机器人

How can I configure my site to allow crawling from well known robots like google, bing, yahoo, alexa etc. and stop other harmful spammers, robots

我应该阻止特定的IP?请讨论任何优点,缺点
在web.config中或IIS做什么?

should i block particular IP? please discuss any pros, cons Anything to be done in web.config or IIS?

我能做到这一点的服务器级的,如果我有具有root访问权限的VPS?

Can I do it server wide If i have vps with root access?

感谢。

推荐答案

我建议你看看我张贴了类似的问题的答案:的如何识别网络爬虫?

I'd recommend that you take a look the answer I posted to a similar question: How to identify web-crawler?

的robots.txt 结果
对robots.txt是礼貌机器人有用的,但是垃圾邮件发送者一般都不会客气所以他们往往忽略的robots.txt;这是伟大的,如果你的robots.txt,因为它可以帮助礼貌机器人。但是,请注意,不要堵塞走错了路,因为它可以抓取,你实际上希望他们抓取内容块好的机器人。

Robots.txt
The robots.txt is useful for polite bots, but spammers are generally not polite so they tend to ignore the robots.txt; it's great if you have robots.txt since it can help the polite bots. However, be careful not to block the wrong path as it can block the good bots from crawling content that you actually want them to crawl.

用户代理结果
通过用户代理拦截也不是傻子,要么证明,因为垃圾邮件发送者往往冒充浏览器和其他流行的用户代理(如谷歌机器人程序)。作为事实上,欺骗用户代理是一个垃圾邮件发送者可以做最简单的事情之一。

User-Agent
Blocking by user-agent is not fool-proof either, because spammers often impersonate browsers and other popular user agents (such as the Google bots). As a matter of fact, spoofing the user agent is one of the easiest thing that a spammer can do.

博特陷阱结果
这可能是最好的办法保护自己从没有礼貌,不正确识别自身的用户代理机器人。至少有两种类型的陷阱:

Bot Traps
This is probably the best way protect yourself from bots that are not polite and that don't correctly identify themselves with the User-Agent. There are at least two types of traps:


  • 的robots.txt的陷阱(只工作,如果机器人读的robots.txt):奉献在robots.txt的禁地目录,并设置服务器来阻止它试图访问任何实体的IP地址该目录中。

  • 创建自己的网页隐藏的链接,也导致禁止目录,并进行爬网的链接和不通过您的robots.txt遵守将步入陷阱,并获得IP阻止任何僵尸。

一个隐藏的链接是其中之一是不可见的一个人,如一个锚标记,没有文字:< A HREF =htt​​p://www.mysite.com/path/to / BOT /陷阱>< / A> 。或者,你可以在锚标记文本,但你可以让字体非常小,改变文字颜色相匹配的背景颜色,使人类无法看到该链接。隐藏链接陷阱可以捕捉任何非人为机器人,所以我建议您用robots.txt的陷阱结合起来,所以你只赶上不好的机器人。

A hidden link is one which is not visible to a person, such as an anchor tag with no text: <a href="http://www.mysite.com/path/to/bot/trap"></a>. Alternately, you can have text in the anchor tag, but you can make the font really small and change the text color to match the background color so that humans can't see the link. The hidden link trap can catch any non-human bot, so I'd recommend that you combine it with the robots.txt trap so that you only catch bad bots.

验证机器人结果
上述步骤可能会帮助你摆脱垃圾邮件发送者的99.9%,但有可能是坏的机器人谁冒充流行的机器人(例如Googlebot)的少数和您的robots.txt遵守;这些机器人可以吃你分配给Googlebot的请求的数量,并可能导致您暂时抓取你的网站谷歌禁止。在这种情况下,你又多了一个选择,这是验证机器人的身份。大多数主要的爬虫(即你希望被抓取)有一个方式,你可以找出自己的机器人,这里是谷歌的建议,核查他们的机器人:<一href=\"http://googlewebmastercentral.blogspot.com/2006/09/how-to-verify-googlebot.html\">http://googlewebmastercentral.blogspot.com/2006/09/how-to-verify-googlebot.html

这是假冒的又一重大BOT和验证失败的任何机器人可以通过IP被封锁。这或许应该让你更接近preventing坏机器人的99.99%抓取您的网站。

Any bot that impersonates another major bot and fails verification can be blocked by IP. That should probably get you closer to preventing 99.99% of the bad bots from crawling your site.

这篇关于如何允许扫描asp.net网站称为网络爬虫和块垃圾邮件和有害的机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆