【问题标题】:robots.txt format to disallow all sub URLsbut not the root URL itselfrobots.txt 格式以禁止所有子 URL,但不允许根 URL 本身
【发布时间】:2017-09-24 11:52:24
【问题描述】:

我的应用程序网址如下所示

http://example.com/app/1

http://example.com/app/2

http://example.com/app/3

...

http://example.com/app/n

现在我想阻止所有这些 URL 被抓取,但不是 http://example.com/app 我如何使用 robots.txt 来做到这一点

【问题讨论】:

    标签: seo robots.txt


    【解决方案1】:

    将以下内容添加到您的 robots.txt

    Disallow: /app/
    

    这将允许http://example.com/app 但不允许http://example.com/app/* 你可以在这里测试你的 robots.txt https://www.google.com/webmasters/tools/robots-testing-tool

    【讨论】:

      猜你喜欢
      • 2023-03-31
      • 2016-09-23
      • 1970-01-01
      • 2016-08-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多