2023-06-23 10:32:03 -04:00
|
|
|
---
|
|
|
|
title: 'Search Engines Indexation'
|
|
|
|
license: 'Apache-2.0'
|
2024-02-24 15:20:29 -05:00
|
|
|
origin_url: 'https://github.com/go-gitea/gitea/blob/d3982bcd814bac93e3cbce1c7eb749b17e413fbd/docs/content/administration/search-engines-indexation.en-us.md'
|
2023-06-23 10:32:03 -04:00
|
|
|
---
|
|
|
|
|
2023-08-05 06:48:30 -04:00
|
|
|
## Search engines indexation of your Forgejo installation
|
2023-06-23 10:32:03 -04:00
|
|
|
|
|
|
|
By default your Forgejo installation will be indexed by search engines.
|
|
|
|
If you don't want your repository to be visible for search engines read further.
|
|
|
|
|
2023-08-05 06:48:30 -04:00
|
|
|
### Block search engines indexation using robots.txt
|
2023-06-23 10:32:03 -04:00
|
|
|
|
|
|
|
To make Forgejo serve a custom `robots.txt` (default: empty 404) for top level installations,
|
2024-02-24 15:20:29 -05:00
|
|
|
create a file with path `public/robots.txt` at the root of the `Custom File Root Path` as displayed in the `/admin/config` page.
|
2023-06-23 10:32:03 -04:00
|
|
|
|
|
|
|
Examples on how to configure the `robots.txt` can be found at [https://moz.com/learn/seo/robotstxt](https://moz.com/learn/seo/robotstxt).
|
|
|
|
|
|
|
|
```txt
|
|
|
|
User-agent: *
|
|
|
|
Disallow: /
|
|
|
|
```
|
|
|
|
|
|
|
|
If you installed Forgejo in a subdirectory, you will need to create or edit the `robots.txt` in the top level directory.
|
|
|
|
|
|
|
|
```txt
|
|
|
|
User-agent: *
|
|
|
|
Disallow: /forgejo/
|
|
|
|
```
|
|
|
|
|
2023-08-05 06:48:30 -04:00
|
|
|
### Disallow crawling archives to save disk space
|
2023-06-23 10:32:03 -04:00
|
|
|
|
|
|
|
If the archive files are crawled, they will be generated dynamically
|
|
|
|
and kept around which can amount to a lot of disk. To prevent that
|
|
|
|
from happening, add the following to the `robots.txt` file:
|
|
|
|
|
|
|
|
```txt
|
|
|
|
User-agent: *
|
|
|
|
Disallow: /*/*/archive/
|
|
|
|
```
|
|
|
|
|
|
|
|
See also a more complete example [at Codeberg](https://codeberg.org/robots.txt).
|