> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/zh/fa-bu/custom-domain/setting-a-custom-subdirectory.md).

# 设置自定义子目录

为你的文档站点设置自定义子目录

使用自定义子目录，你可以让你的文档站点可在 `example.com/docs`。这不同于一个 [自定义域名](/docs/documentation/zh/fa-bu/custom-domain.md) 它可以让你的文档站点可通过以下地址访问 `docs.example.com`.

这样做的一个原因是让你的文档 URL 与你网站上的其他 URL 保持一致的格式。使用子目录也可能有利于 SEO。

要配置子目录，你需要先在网站后端进行设置，然后在 GitBook 站点设置中完成最后步骤。

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="image">封面图</th><th data-hidden data-type="image">封面图（深色）</th><th data-hidden data-type="image">封面图（深色）</th><th data-hidden data-card-cover-dark data-type="image">封面图（深色）</th></tr></thead><tbody><tr><td>使用 Cloudflare 配置子目录</td><td><a href="/docs/documentation/zh/fa-bu/custom-domain/setting-a-custom-subdirectory/configuring-a-subdirectory-with-cloudflare.md">使用 Cloudflare 配置子目录</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FGYtERTwSsUtqY1crFSnk%2FCloudflare.png?alt=media&amp;token=c4aadcb8-d16e-47d2-ad33-56d137ddbd99">25_12_10_cloudflare_1.png</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F3zWvv4mOHebRyQB34CHx%2FCloudflare.svg?alt=media&amp;token=f4109747-5c4d-4039-8b33-168569f41d9d">25_08_29_cloudflare.svg</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F3zWvv4mOHebRyQB34CHx%2FCloudflare.svg?alt=media&amp;token=f4109747-5c4d-4039-8b33-168569f41d9d">25_08_29_cloudflare.svg</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FRQMKddJVVyo47jdleeyw%2FCloudflare.png?alt=media&amp;token=0f117eb3-2270-48c5-b622-e971374b7a5a">25_12_10_cloudflare.png</a></td></tr><tr><td>使用 Vercel 配置子目录</td><td><a href="/docs/documentation/zh/fa-bu/custom-domain/setting-a-custom-subdirectory/configuring-a-subdirectory-with-vercel.md">使用 Vercel 配置子目录</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F6vihVGnoaGJIK47oiPIt%2FVercel.png?alt=media&amp;token=52cba085-83bf-4aca-9d5f-9a61141e6ec7">25_12_10_vercel_1.png</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F4Dra7NQYfLaHJdhBTful%2FVercel.svg?alt=media&amp;token=e53c02a9-86fe-4ddc-8585-5cd0cef82ed4">25_08_29_vercel.svg</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F4Dra7NQYfLaHJdhBTful%2FVercel.svg?alt=media&amp;token=e53c02a9-86fe-4ddc-8585-5cd0cef82ed4">25_08_29_vercel.svg</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FuO2stsXgYy2m3MOndCtz%2FVercel.png?alt=media&amp;token=6719d901-d0d4-4eeb-9569-faa0607cefd6">25_12_10_vercel.png</a></td></tr><tr><td>使用 AWS 配置子目录</td><td><a href="/docs/documentation/zh/fa-bu/custom-domain/setting-a-custom-subdirectory/configuring-a-subdirectory-with-aws.md">使用 AWS 的 CloudFront 和 Route 53 配置子目录</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FYf6n0ahpdjIA7b9Jba2N%2FAWS.png?alt=media&amp;token=52c282fd-5f63-47ec-8a88-6f0cca3680fe">25_12_10_aws_1.png</a></td><td></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FjY2LAVXbmW6RUmaTwXxF%2FAWS%20-%20dark.png?alt=media&amp;token=ae589916-116d-4a29-8d59-985552addda5">25_10_23_aws.png</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FAtNKcIuzR5zE8wUVHR0O%2FAWS.png?alt=media&amp;token=36b45c4e-0c33-47aa-b73c-5f59fd0649ff">25_12_10_aws.png</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/zh/fa-bu/custom-domain/setting-a-custom-subdirectory.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
