![gitweb 安装的理想 robots.txt?](https://linux22.com/image/801476/gitweb%20%E5%AE%89%E8%A3%85%E7%9A%84%E7%90%86%E6%83%B3%20robots.txt%EF%BC%9F.png)
我使用 gitweb(和 gitolite)在 git.nomeata.de 上托管了一些 git 存储库。偶尔,搜索引擎蜘蛛会过来并开始攻击界面。虽然我通常希望我的 git 存储库出现在搜索引擎中,但我不想完全阻止它们。但它们不应调用昂贵的操作,例如快照存档、搜索或生成差异。
robots.txt
对于这样的安装来说“最佳”文件是什么?
答案1
我想这是一个很好的社区 wiki。如果您认为可以改进,请扩展此 robots.txt:
User-agent: *
Disallow: /*a=search*
Disallow: /*/search/*
Disallow: /*a=blobdiff*
Disallow: /*/blobdiff/*
Disallow: /*a=commitdiff*
Disallow: /*/commitdiff/*
Disallow: /*a=snapshot*
Disallow: /*/snapshot/*
Disallow: /*a=blame*
Disallow: /*/blame/*