# 使用 robots.txt 完全阻止私有网站的所有索引

**URL:** <https://meta.discourse.org/t/robots-txt-to-completely-block-all-indexing-of-private-site/143429>\
**Category:** Support\
**Created:** [2020年三月5日 17:28 UTC](https://meta.discourse.org/t/robots-txt-to-completely-block-all-indexing-of-private-site/143429 "2020-03-05T17:28:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![L30110](https://avatars.discourse-cdn.com/v4/letter/l/eb9ed0/32.png) [@L30110](https://meta.discourse.org/u/L30110)\
**Post date:** [2020年三月5日 17:28 UTC](https://meta.discourse.org/t/robots-txt-to-completely-block-all-indexing-of-private-site/143429/1 "2020-03-05T17:28:03Z")

</div>

你好。我查看了以下讨论：

> [@Needing to edit robots.txt file - where is it?](https://meta.discourse.org/t/needing-to-edit-robots-txt-file-where-is-it/93879/17):
>
> You are completely hijacking a topic here that is asking for removal of items from the Google index. Feel free to open a dedicated topic to discuss this. There are changes we do support like having a reasonable HTML off version of the user summary page… however you are doing is totally derailing this topic. We have survived fine for the last 5 years without indexing user pages, lots of users DO NOT want their forum user page indexed by Google. Tons of profiles are thin and pointless. Turning th…

但并未找到关于此问题的明确答案。如何为 Discourse 站点启用 robots.txt 文件，以指示任何爬虫都不应对其进行索引？这是关于一个私有站点的问题，该站点无需在任何搜索引擎中出现。谢谢！

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [2020年三月5日 17:46 UTC](https://meta.discourse.org/t/robots-txt-to-completely-block-all-indexing-of-private-site/143429/2 "2020-03-05T17:46:46Z")

</div>

查看该主题中的倒数第二条回复：[Needing to edit robots.txt file - where is it? - #42 by Osama](https://meta.discourse.org/t/needing-to-edit-robots-txt-file-where-is-it/93879/42?u=jomaxro%E3%80%82)

---

<div class="post-metadata">

**Author:** ![L30110](https://avatars.discourse-cdn.com/v4/letter/l/eb9ed0/32.png) [@L30110](https://meta.discourse.org/u/L30110)\
**Post date:** [2020年三月5日 18:17 UTC](https://meta.discourse.org/t/robots-txt-to-completely-block-all-indexing-of-private-site/143429/3 "2020-03-05T18:17:04Z")

</div>

啊，漏掉了下面那个。完美。效果非常好。谢谢！

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2020年三月6日 08:17 UTC](https://meta.discourse.org/t/robots-txt-to-completely-block-all-indexing-of-private-site/143429/4 "2020-03-06T08:17:16Z")

</div>

另外，请通过访问 [discourse.yoursite.com/wizard](http://discourse.yoursite.com/wizard) 重新运行向导，确保已开启“需要登录”设置。这也将阻止搜索引擎访问。

---

<div class="post-metadata">

**Author:** ![L30110](https://avatars.discourse-cdn.com/v4/letter/l/eb9ed0/32.png) [@L30110](https://meta.discourse.org/u/L30110)\
**Post date:** [2020年三月6日 15:38 UTC](https://meta.discourse.org/t/robots-txt-to-completely-block-all-indexing-of-private-site/143429/5 "2020-03-06T15:38:44Z")

</div>

该网站一直要求登录，且不允许用户自行注册。然而，它仍出现在搜索引擎中——只是由于无法登录，没有任何内容被索引。我希望通过 robots.txt 明确阻止后，任何提及都将停止。谢谢。

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2020年四月5日 15:38 UTC](https://meta.discourse.org/t/robots-txt-to-completely-block-all-indexing-of-private-site/143429/6 "2020-04-05T15:38:52Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
