我有以下结构
http://example.com/universities/UNIVERSITY_ID/review
我试图禁止评论页面,但保留动态的 UNIVERSITY_ID 页面。
我怎样才能在
robots.txt
这行得通吗?
Disallow: /universities/*/review
使用通配符是解决此问题的更好解决方案。
User-agent: * disallow: /*review$
参考:https://webmasters.stackexchange.com/questions/72722/can-we-use-regex-in-robots-txt-file-to-block-urls