Files
docs/i18n/zh-tw/docusaurus-plugin-content-docs/version-1.24/administration/search-engines-indexation.md
T

31 lines
902 B
Markdown
Raw Normal View History

2025-05-05 16:47:20 +00:00
---
date: "2023-05-23T09:00:00+08:00"
slug: "search-engines-indexation"
sidebar_position: 60
aliases:
- /zh-tw/search-engines-indexation
---
# 搜索引擎索引
2025-09-03 21:00:35 +00:00
默认情况下,您的 Gitea 安裝将被搜索引擎索引。
如果您不希望您的存放庫对搜索引擎可见,請進一步阅读。
2025-05-05 16:47:20 +00:00
## 使用 robots.txt 阻止搜索引擎索引
2025-09-03 21:00:35 +00:00
為了使 Gitea 為顶级安裝提供自定义的`robots.txt`(默认為空的 404),請在 [`custom`文件夹或`CustomPath`](administration/customizing-gitea.md)中建立一个名為 `public/robots.txt` 的文件。
2025-05-05 16:47:20 +00:00
2025-09-03 21:00:35 +00:00
有关如何配置 `robots.txt` 的示例,請参考 [https://moz.com/learn/seo/robotstxt](https://moz.com/learn/seo/robotstxt)。
2025-05-05 16:47:20 +00:00
```txt
User-agent: *
Disallow: /
```
2025-09-03 21:00:35 +00:00
如果您将 Gitea 安裝在子目錄中,则需要在顶级目錄中建立或编辑 `robots.txt`。
2025-05-05 16:47:20 +00:00
```txt
User-agent: *
Disallow: /gitea/
```