gpt4 book ai didi

robots.txt - 在 robots.txt 文件中使用 "Disallow:/*?"

转载 作者:行者123 更新时间:2023-12-04 00:03:09 29 4
gpt4 key购买 nike

我用过

Disallow: /*?

在 robots.txt 文件中禁止所有可能包含“?”的页面在 URL 中。

语法是否正确,还是我也屏蔽了其他页面?

最佳答案

这取决于机器人。

遵循原始 robots.txt 规范的机器人不会赋予 * 任何特殊含义。这些机器人会阻止任何路径以 /* 开头,紧接着是 ? 的 URL,例如,http://example.com/*?foo.

一些机器人,包括 Googlebot,赋予 * 字符特殊的含义。它通常代表任何字符序列。这些机器人会阻止您似乎想要的东西:任何带有 ? 的 URL。

Google’s robots.txt documentation包括这种情况:

To block access to all URLs that include question marks (?). For example, the sample code blocks URLs that begin with your domain name, followed by any string, followed by a question mark, and ending with any string:

User-agent: Googlebot
Disallow: /*?

关于robots.txt - 在 robots.txt 文件中使用 "Disallow:/*?",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41140542/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com