Robots.txt 禁止使用某些文件夹名称 [英] Robots.txt Disallow Certain Folder Names

查看:40
本文介绍了Robots.txt 禁止使用某些文件夹名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁止机器人抓取任何文件夹,在 url 的任何位置,名称为:this-folder.

I want to disallow robots from crawling any folder, at any position in the url with the name: this-folder.

禁止示例:

http://mysite.com/this-folder/
http://mysite.com/houses/this-folder/
http://mysite.com/some-other/this-folder/
http://mysite.com/no-robots/this-folder/

这是我的尝试:

Disallow: /.*this-folder/

这行得通吗?

推荐答案

官方不支持通配符和正则表达式:

Officially globbing and regular expressions are not supported:

http://www.robotstxt.org/robotstxt.html

但显然有些搜索引擎支持这一点.

but apparently some search engines support this.

这篇关于Robots.txt 禁止使用某些文件夹名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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