wangsisi 发表于 2011-5-26 15:35:52

如何设置MediaWiki平台网站的Robots.txt

很多时候造成服务器过忙的原因很可能不是别人故意攻击,而是一些搜索引擎蜘蛛来爬引起的。
MediaWiki系统的一个特点是站内链接特别多,每一个页面都对应有&action=edit, history, move, talk以及链出更改、链入页面、旧版本、新老版本比较等链接,这有利于人工操作、编辑,一些聪明的蜘蛛(例如Google Bot)来说不会迷路,但对于设计得不好的搜索引擎蜘蛛来说就沿着各种可能的链接到处乱窜,又因为这些蜘蛛的服务器强大、网络带宽充裕,可以对我们服务器进行非常密集的访问,就直接导致我们的服务器因为过载而瘫痪。
  于是和这些搜索引擎蜘蛛沟通就很重要了,开始我们网站都没有Robots.txt,可以建一个允许所有蜘蛛访问所有链接的Robots.txt,这当然也起不到屏蔽的作用,参考维基百科、Mahalo等网站的Robots.txt文件,再去重新编辑网站的Robots.txt,以及编辑进行更多链接屏蔽,增加部分蜘蛛遵守的参数Crawl-delay和Request-rate,以期能让搜索引擎蜘蛛更明白我们的意图,更友好地合作下去。
  与搜索引擎配合好至关重要,对它们的蜘蛛只能进行引导,强行屏蔽只能让它们放弃收录,不利于网站发展。希望这些改动能收到好的效果,继续观察看看。
以下是目前的Robots.txt:
# robots.txt file from 18dao wiki project
# add for www.18dao.cn by jamesqi 2008-9-27
User-agent: *
Disallow: /User*
Disallow: /QC*
Disallow: /Note*
Disallow: /Task*
Disallow: /skins
Disallow: /Special:Random
Disallow: /Special%3ARandom
Disallow: /Special:Search
Disallow: /Special%3ASearch
Disallow: /Special:Recentchangeslinked/
Disallow: /Special%3ARecentchangeslinked/
Disallow: /index.php?title=Special:Random
Disallow: /index.php?title=Special:%3ARandom
Disallow: /index.php?title=Special:Search
Disallow: /index.php?title=Special:%3ASearch
Disallow: /*action*
Disallow: /*oldid=*
Disallow: /*diff
Crawl-delay: 5         # set to 5 seconds to wait between successive requests to the same server
Request-rate: 1/5         # maximum rate is one page every 5 seconds
# Some bots are known to be trouble, particularly those designed to copy
# entire sites. Please obey robots.txt.
User-agent: sitecheck.internetseer.com
Disallow: /
User-agent: Zealbot
Disallow: /
User-agent: MSIECrawler
Disallow: /
User-agent: SiteSnagger
Disallow: /
User-agent: WebStripper
Disallow: /
User-agent: WebCopier
Disallow: /
User-agent: Fetch
Disallow: /
User-agent: Offline Explorer
Disallow: /
User-agent: Teleport
Disallow: /
User-agent: TeleportPro
Disallow: /
User-agent: WebZIP
Disallow: /
User-agent: linko
Disallow: /
User-agent: HTTrack
Disallow: /
User-agent: Microsoft.URL.Control
Disallow: /
User-agent: Xenu
Disallow: /
User-agent: larbin
Disallow: /
User-agent: libwww
Disallow: /
User-agent: ZyBORG
Disallow: /
User-agent: Download Ninja
Disallow: /

页: [1]
查看完整版本: 如何设置MediaWiki平台网站的Robots.txt

美国HostEase虚拟主机一年198元