gpt4 book ai didi

.htaccess - 如何在 robots.txt 或 .htaccess 上阻止某种类型的 url?

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:50:17 26 4
gpt4 key购买 nike

目前在我的网上商店中,在页面太多的类别页面上,url 以 https://www.example.com?p=2 结尾p=3...我想告诉 robots.txt 不要索引以 p=Number 结尾的 url。我该怎么做呢?顺便说一下,这是一个 prestashop 网站。

谢谢大家。

最佳答案

只需将这一行添加到您的 robots.txt 文件中:

Disallow: /?p=*

例如,这将阻止像 example.com/?p=2 这样的 URL 被 Google 之类的网站编入索引。 * 符号代表所有。所以 p= 之后的任何内容都将被包含在内。

关于.htaccess - 如何在 robots.txt 或 .htaccess 上阻止某种类型的 url?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51543701/

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