seo - 允许子目录索引但不允许子目录中的其他页面

标签 seo robots.txt

在 robots.txt 中...

我想允许目录的索引或主页。

/landing/

我不想在目录中允许任何其他页面。

/landing/page  
/landing/anypage

如何做到这一点?

最佳答案

User-agent: *
Allow: /landing/$
Disallow: /landing/

根据 Google 网站管理员的说法,您可能只需要 Allow 指令:

enter image description here 来源:https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt?hl=en#order-of-precedence-for-group-member-records

关于seo - 允许子目录索引但不允许子目录中的其他页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38043199/

相关文章:

PHP 或 jQuery/PHP 分页

php - SEO 友好的 URL 带有/

html - 多个 Schema.org 产品项目及其在搜索引擎结果中的外观如何?

asp.net - 当强制使用 SSL 时,如何排除某些文件夹被 ASP.net 中的搜索引擎索引?

php - 我想在不使用 slug 的情况下使 PHP seo 的博客 Url 友好

Javascript 选项卡,seo 优化

ruby-on-rails-5 - AWS EBS - Rails5/nginx - robots.txt 未找到错误 (404)

asp.net - 如何以及在何处将 robots.txt 文件添加到 ASP.net Web 应用程序?

seo - 从 google 和 yahoo 中删除子域

Robots.txt 不允许