# 我希望Google索引域名/u/用户名格式的链接内容，我应该怎么做？

**URL:** https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485
**Category:** Support
**Created:** [2024 年8 月 7 日 03:36 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485 "2024-08-07T03:36:58Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### 作者： ![toanvoc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toanvoc/32/423586_2.png) [@toanvoc](https://meta.discourse.org/u/toanvoc)
#### 发布日期： [2024 年8 月 7 日 03:36 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/1 "2024-08-07T03:36:59Z")

</div>

我希望Google能够索引链接格式为domain/u/username的内容，我该怎么做？

我已经移除了Disallow: /u部分，[以便Google能够索引domain.com/u的链接格式，但如果我想让domain/u/username的slug格式被Google索引，我该怎么做？还有其他配置吗？](http://xn--Googledomain-h86sm9g0v7cv6tuy0jtro.com/u%E7%9A%84%E9%93%BE%E6%8E%A5%E6%A0%BC%E5%BC%8F%EF%BC%8C%E4%BD%86%E5%A6%82%E6%9E%9C%E6%88%91%E6%83%B3%E8%AE%A9domain/u/username%E7%9A%84slug%E6%A0%BC%E5%BC%8F%E8%A2%ABGoogle%E7%B4%A2%E5%BC%95%EF%BC%8C%E6%88%91%E8%AF%A5%E6%80%8E%E4%B9%88%E5%81%9A%EF%BC%9F%E8%BF%98%E6%9C%89%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE%E5%90%97%EF%BC%9F)

我没有登录，无法访问slug格式：domain/u/username，所以我看到Google索引这个slug格式存在问题（见附图）。

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/0/d/50d99defab77b94b54780bbd9f67e0a612734f24.png)

感谢您的支持，我是source discourse的新手，还有很多不明白的地方。谢谢！

---

<div class="post-metadata">

### 作者： ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### 发布日期： [2024 年8 月 7 日 05:31 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/2 "2024-08-07T05:31:15Z")

</div>

您好 👋

您的网站是否启用了“`隐藏用户个人资料”`设置？

如果启用了，请禁用它，这样您无需登录即可访问用户个人资料。

---

<div class="post-metadata">

### 作者： ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### 发布日期： [2024 年8 月 7 日 05:46 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/3 "2024-08-07T05:46:48Z")

</div>

您确定您的用户对您想告诉全世界他们是会员以及其他一些事情感到同样高兴吗？

---

<div class="post-metadata">

### 作者： ![toanvoc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toanvoc/32/423586_2.png) [@toanvoc](https://meta.discourse.org/u/toanvoc)
#### 发布日期： [2024 年8 月 7 日 05:46 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/4 "2024-08-07T05:46:53Z")

</div>

非常感谢！

---

<div class="post-metadata">

### 作者： ![toanvoc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toanvoc/32/423586_2.png) [@toanvoc](https://meta.discourse.org/u/toanvoc)
#### 发布日期： [2024 年8 月 8 日 02:41 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/5 "2024-08-08T02:41:37Z")

</div>

但我仍然无法以 domain/u/username 的形式提交链接以在 Google 中索引，我还需要打开什么？

（我已附上图片供您查看状态）

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/a/2/ca27b386cf46eec42bfcd0984f695f2dfa0d5502.png)

---

<div class="post-metadata">

### 作者： ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### 发布日期： [2024 年8 月 8 日 10:49 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/6 "2024-08-08T10:49:24Z")

</div>

如果我没记错的话，这个限制比 `robots.txt` 要深一些。当然，这是一个相当快的测试，允许在 `robots.txt` 中使用 `/u`。但如果它来自核心深处，你可能需要一个插件。

在这里挖掘一下。这大概是一年前的事情了，随着 SEO 的发展而出现，并且有充分的理由不允许这样做。

---

<div class="post-metadata">

### 作者： ![toanvoc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toanvoc/32/423586_2.png) [@toanvoc](https://meta.discourse.org/u/toanvoc)
#### 发布日期： [2024 年8 月 8 日 13:13 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/7 "2024-08-08T13:13:57Z")

</div>

我已将其放入 robots.txt（附件图片），但无效，因此我在此处向您寻求帮助。

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/4/9/549ca61f821530c21e85e714690a4f860191e18d.png)

---

<div class="post-metadata">

### 作者： ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### 发布日期： [2024 年8 月 8 日 20:42 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/8 "2024-08-08T20:42:15Z")

</div>

“查看实时测试”是否为您提供了更多信息？

---

<div class="post-metadata">

### 作者： ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### 发布日期： [2024 年8 月 8 日 23:23 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/9 "2024-08-08T23:23:02Z")

</div>

这可能是因为用户个人资料发送了这个 HTTP 标头：

- `x-robots-tag: noindex`

如果你在终端中运行以下命令，替换 `\u003curl\u003e` 为用户个人资料的 URL，就可以看到它：

```plaintext
curl -sSL -D - -o /dev/null \u003curl\u003e

```

如果你删除了 `robots.txt` 规则，Google 就会看到这个标头并取消索引这些 URL。

Google 文档：

> **[Robots Meta Tags Specifications | Google Search Central  | ...](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)**
>
> Learn how to add robots meta tags and read how page and text-level settings can be used to adjust how Google presents your content in search results.

---

<div class="post-metadata">

### 作者： ![toanvoc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toanvoc/32/423586_2.png) [@toanvoc](https://meta.discourse.org/u/toanvoc)
#### 发布日期： [2024 年8 月 9 日 01:08 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/10 "2024-08-09T01:08:08Z")

</div>

我知道该网址是 Noindex，但我不知道在哪里编辑源 discourse。在 robots.txt 文件中，Disallow: /u 部分已被删除。我附上了一张照片。

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/9/9/e99546079af6de36b222a6c5a7b114685d0362f5.png)

---

<div class="post-metadata">

### 作者： ![toanvoc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toanvoc/32/423586_2.png) [@toanvoc](https://meta.discourse.org/u/toanvoc)
#### 发布日期： [2024 年9 月 22 日 07:32 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/11 "2024-09-22T07:32:10Z")

</div>

帮助我将 slug 索引到源代码的用户名中？

我想像这样为 slug 域打开索引：[https://domain.com/u/toannguyen/activity（示例链接），我在](https://domain.com/u/toannguyen/activity%EF%BC%88%E7%A4%BA%E4%BE%8B%E9%93%BE%E6%8E%A5%EF%BC%89%EF%BC%8C%E6%88%91%E5%9C%A8) discourse 源代码中需要做什么？

目前，当我在 Google Search Console 中提交此类链接时，它会显示被阻止索引。希望得到帮助？

非常感谢团队！

---

<div class="post-metadata">

### 作者： ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### 发布日期： [2024 年9 月 22 日 07:48 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/12 "2024-09-22T07:48:03Z")

</div>

我不知道，但您为什么要这样做？这并不是人们会搜索的内容。它不会改善您的 SEO，而且 Googlebot 已经可以访问所有允许的网址。

---

<div class="post-metadata">

### 作者： ![toanvoc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toanvoc/32/423586_2.png) [@toanvoc](https://meta.discourse.org/u/toanvoc)
#### 发布日期： [2024 年9 月 22 日 08:35 UTC](https://meta.discourse.org/t/i-want-google-to-index-the-content-in-the-link-format-domain-u-username-what-should-i-do/320485/13 "2024-09-22T08:35:03Z")

</div>

我需要做什么本地社区发展模型？我已经向我的会员公开了！
