RGJ
(Richard - Communiteq)
1
编辑:这原来是一个错误,请参见第 3 楼
如果勾选了“向公众隐藏用户资料”,那么在 robots.txt 中不应该禁止 /u 吗?
否则搜索引擎会遇到 403 错误,这可能会影响排名和可见性。
这据称是在 2014 年实现的 Excluding user profiles in robots.txt (or allow edit of file) - #2 by neil Disallow /users/ in robots.txt · discourse/discourse@8267a45 · GitHub
我能找到的唯一在 robots.txt 中包含 Disallow: /u 的 Discourse 论坛是 Meta আশ্চর্যজনক:
1 个赞
Moin
2
RGJ
(Richard - Communiteq)
3
找得好 @Moin
目前,我们已经在 /u 路由中添加了 noindex。然而,由于 robots.txt 屏蔽了这些页面,搜索引擎无法看到该头部信息。
所以,这指向了之前的一个更改 FIX: Always noindex /u routes - Pull Request #27712 - discourse/discourse - GitHub
其中提到
其次,SiteSetting.hide_user_profiles_from_public 会抛出 Forbidden 异常,这导致我们的 after_action: add no index header 无法触发。
此 PR 确保通过 before_action 添加 noindex 头部信息。我们可能会考虑从
discourse/app/controllers/robots_txt_controller.rb
2900cbe 中的第 24 行
DISALLOWED_WITH_HEADER_PATHS = %w[/badges /u/ /my /search /tag//l /g /t//.rss /c/.rss]
不幸的是,这并不总是有效。虽然 /u/rgj 确实有 x-robots-tag: noindex 头部,但 /u/rgj/summary 却没有,所以看起来最近的更改产生了一些不想要的副作用。
(移至 Contribute > Bug)
1 个赞