【问题标题】:robots.txt deny access to specific URL parameters with pretty urlsrobots.txt 拒绝访问带有漂亮 url 的特定 URL 参数
【发布时间】:2013-11-11 15:23:47
【问题描述】:

我有一个使用漂亮 url 的网站,需要使用 robots.txt 阻止某些参数的搜索。

我的 url 结构是这样的: http://example.com/vcond/Used/make/mymake/features/myfeatures

只有在 features 是 url 的参数时,我才能使用 robots.txt 阻止 url。 我读到你可以这样做:

Disallow: *features

这将阻止机器人访问任何具有功能的网址。这是真的?但我需要这样的网址:http://example.com/vcond/Used/make/mymake 工作!!

谢谢

【问题讨论】:

    标签: robots.txt


    【解决方案1】:
    Disallow: /*/features
    

    应该做的伎俩。见https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt

    另外,请参阅此主题:Robots.txt: Is this wildcard rule valid?

    【讨论】:

    • 请注意,这不适用于所有 robots.txt 解析器,因为 Disallow 中的 * 通配符不是原始 robots.txt 规范的一部分。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-04-16
    • 2016-02-17
    • 2015-01-15
    • 1970-01-01
    • 2014-09-24
    • 2013-07-09
    • 1970-01-01
    相关资源
    最近更新 更多