问题原文
原帖链接 · Julio · CC BY-SA 4.0
Take for example
/about?param1=blah
/contact?param1=bleh¶m2=bluh
But allow
/about
/contact
Is that possible? Would disallowing /about?* work?
已采纳解答
原帖链接 · Henry Visotski · CC BY-SA 4.0
Yoast's guide to robots.txt has the solution:
User-agent: *
Disallow: /*?*
(Replace the User-agent as necessary.)
The line above accounts for everything that comes after the first forward slash (after your root domain name), on either side of the question mark parameter delimiter, which needs to be present in the URL.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
