如何prevent Googlebot抓取robots.txt中和的.htaccess文件的索引类型 [英] How to prevent googlebot from indexing files types in robots.txt and .htaccess

查看:208
本文介绍了如何prevent Googlebot抓取robots.txt中和的.htaccess文件的索引类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关于如何从索引prevent谷歌机器人,例如, TXT 文件很多堆栈溢出的问题。有这样的:

There are many Stack Overflow questions on how to prevent google bot from indexing, for instance, txt files. There's this:

的robots.txt

User-agent: Googlebot Disallow: /*.txt$

的.htaccess

<Files ~ "\.txt$">
     Header set X-Robots-Tag "noindex, nofollow"
</Files>

不过,从被索引试图prevent两种类型的文件时,什么是这两种语法?在我的情况 - TXT 商务部

推荐答案

在您的robots.txt文件:

In your robots.txt file:

User-agent: Googlebot
Disallow: /*.txt$
Disallow: /*.doc$

在谷歌网站管理员更多细节:创建一个robots.txt文件

在您的.htaccess文件:

In your .htaccess file:

<FilesMatch "\.(txt|doc)$">
    Header set X-Robots-Tag "noindex, nofollow"
</FilesMatch>

这里

更多细节: http://httpd.apache.org/docs/current/ sections.html

这篇关于如何prevent Googlebot抓取robots.txt中和的.htaccess文件的索引类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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