Robots.txt:不允许文件夹的名称,无论它可能显示在哪个深度 [英] Robots.txt: disallow a folder's name, regardless at which depth it may show up

查看:60
本文介绍了Robots.txt:不允许文件夹的名称,无论它可能显示在哪个深度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我必须禁止搜索引擎索引我们的 REST 网络服务响应(它是一个 Sitecore 网站);它们都在 URL 中具有相同的名称,但显示在服务器层次结构中的不同级别,我想知道我是否可以在我们的机器人文件中编写一个捕获所有"条目,或者我是否注定要编写一个广泛的列表.

So I have to disallow search engines from indexing our REST web service responses (it's a Sitecore website); all of them have the same name in the URL but show up at different levels in the server hierarchy, and I was wondering if I can write a "catch all" entry in our robots file or if I am doomed to write an extensive list.

我可以添加类似的东西吗

Can I add something like

Disallow: */ajax/*

捕获所有名为ajax"的文件夹,而不管它们出现在哪里?

to catch all folders named "ajax" regardless of where they appear?

推荐答案

robots.txt 规范没有说明通配符,但 Google (Google Robots.txt 规范)和 Bing 允许在 robots.txt 文件中使用通配符.

robots.txt specification doesn't say anything about wildcards but Google (Google Robots.txt Specifications) and Bing allow the use of wildcards in robots.txt files.

Disallow: */ajax/*

您的 disallow 对所有 /ajax/ url 都有效,无论 /ajax/ 的嵌套级别是什么.

Your disallow is valid for all the /ajax/ urls no matter what is the nesting level of /ajax/.

这篇关于Robots.txt:不允许文件夹的名称,无论它可能显示在哪个深度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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