For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
预约演示登录免费开始
  • 入门
    • 概览
    • 工作原理
    • 快速开始
    • 项目结构
    • Customer showcase
    • 变更日志
  • 配置
    • 概览
    • 站点级设置
    • 页面级设置
  • 编写内容
    • Markdown 基础
    • Markdown 中的富媒体
    • Fern 编辑器
    • 可复用代码片段
  • AI 功能
    • 概览
    • Fern Writer
    • AI 生成的示例
    • Markdown 访问
      • 概览
      • Agent 指令
      • 智能体指令
      • 分析与集成
    • MCP 服务器
    • API 目录发现
      • 概览
      • 设置 SEO 元数据
      • 配置 slug
      • 重定向
      • 自定义 robots.txt
  • Public API
    • GETJWT from Fern API key
    • GETAlgolia search credentials
    • GETCurrent user information
  • Fern Writer API
    • GETGet Fern Writer Install Link
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
预约演示登录免费开始
在本页
  • 配置
SEO 与 GEO

自定义 robots.txt

||以 Markdown 格式查看|
此页面是否有帮助?
在仪表板中编辑
上一个

配置重定向

下一个

身份验证选项概述

默认情况下,Fern 在您的文档站点根目录提供一个自动生成的 robots.txt,允许所有爬虫并指向您的 sitemap.xml。使用 docs.yml 中的 agents.robots-txt 键 来提供您自己的文件——这对于选择接受或拒绝特定的 AI 爬虫、限制敏感部分或使用 Cloudflare 内容信号策略 表明偏好非常有用。

robots.txt 只是建议性的:合规的爬虫会遵循您的 Disallow 和 Allow 指令,但忽略协议的机器人仍然可以访问这些路径。对于必须保持私有的内容,请使用身份验证。

robots.txt 决定哪些爬虫可以访问您的站点以及您广播什么 AI 训练信号。它的配套文件 llms.txt 和 llms-full.txt 则影响 AI 代理爬取后接收到的内容。

配置

1

在 docs.yml 中将 agents.robots-txt 指向您的文件

docs.yml
1agents:
2 robots-txt: ./robots.txt

路径是相对于 docs.yml 的。

2

编写您的自定义 robots.txt

robots.txt
# 允许搜索引擎
User-Agent: Googlebot
Allow: /
# 限制 AI 爬虫访问私有路径
User-Agent: GPTBot
Disallow: /private
# 通过 Cloudflare 内容信号声明 AI 使用偏好
Content-Signal: ai-train=yes, search=yes, ai-input=yes
# 为爬虫指向您的站点地图——Fern 的默认 robots.txt 包含此项,
# 所以在用自定义文件替换默认文件时需要添加回来
Sitemap: https://docs.example.com/sitemap.xml

将命名的机器人(如 GPTBot、Googlebot)放在文件中任何通配符组之前——Fern 在提供文件时会附加自己的 User-Agent: * 块。

3

Fern 提供您的文件

您的文件会在 /robots.txt 原样提供。Fern 会在末尾附加一个托管块,禁止内部 API 路由:

# Fern 托管的路由——自动禁止
User-Agent: *
Disallow: /api/fern-docs/