mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
2 years ago
|
---
|
||
|
date: "2023-05-23T09:00:00+08:00"
|
||
|
title: "搜索引擎索引"
|
||
|
slug: "search-engines-indexation"
|
||
1 year ago
|
sidebar_position: 60
|
||
2 years ago
|
toc: false
|
||
|
draft: false
|
||
|
aliases:
|
||
|
- /zh-cn/search-engines-indexation
|
||
|
menu:
|
||
|
sidebar:
|
||
|
parent: "administration"
|
||
|
name: "搜索引擎索引"
|
||
1 year ago
|
sidebar_position: 60
|
||
2 years ago
|
identifier: "search-engines-indexation"
|
||
|
---
|
||
|
|
||
|
# Gitea 安装的搜索引擎索引
|
||
|
|
||
|
默认情况下,您的 Gitea 安装将被搜索引擎索引。
|
||
|
如果您不希望您的仓库对搜索引擎可见,请进一步阅读。
|
||
|
|
||
|
## 使用 robots.txt 阻止搜索引擎索引
|
||
|
|
||
1 year ago
|
为了使 Gitea 为顶级安装提供自定义的`robots.txt`(默认为空的 404),请在[`custom`文件夹或`CustomPath`](administration/customizing-gitea.md)中创建一个名为 `robots.txt` 的文件。
|
||
2 years ago
|
|
||
|
有关如何配置 `robots.txt` 的示例,请参考 [https://moz.com/learn/seo/robotstxt](https://moz.com/learn/seo/robotstxt)。
|
||
|
|
||
|
```txt
|
||
|
User-agent: *
|
||
|
Disallow: /
|
||
|
```
|
||
|
|
||
|
如果您将Gitea安装在子目录中,则需要在顶级目录中创建或编辑 `robots.txt`。
|
||
|
|
||
|
```txt
|
||
|
User-agent: *
|
||
|
Disallow: /gitea/
|
||
|
```
|