# 设置自定义子目录

使用自定义子目录，你可以让你的文档站点可通过以下地址访问： `example.com/docs`。这不同于 [自定义域名](/docs/documentation/zh/docs-site/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="/pages/d7fc109c2239b79253037358f6ab53ffb8e0993f">/pages/d7fc109c2239b79253037358f6ab53ffb8e0993f</a></td><td><a href="/files/c2ab61e6a0a6eae2a4e7fad5bf37091f1b7d807e">/files/c2ab61e6a0a6eae2a4e7fad5bf37091f1b7d807e</a></td><td><a href="/files/5df32e4b7a9dbb5fe9e83bb6534098aef08be428">/files/5df32e4b7a9dbb5fe9e83bb6534098aef08be428</a></td><td><a href="/files/5df32e4b7a9dbb5fe9e83bb6534098aef08be428">/files/5df32e4b7a9dbb5fe9e83bb6534098aef08be428</a></td><td><a href="/files/d9ebb574f981070b5f56c9c81caff6776c1fbbae">/files/d9ebb574f981070b5f56c9c81caff6776c1fbbae</a></td></tr><tr><td>使用 Vercel 配置子目录</td><td><a href="/pages/85dd5951b082fd341de483720c83ed32de0fc1f0">/pages/85dd5951b082fd341de483720c83ed32de0fc1f0</a></td><td><a href="/files/f98aec7b9b6728185d01da3a9d21b5f367ee79e1">/files/f98aec7b9b6728185d01da3a9d21b5f367ee79e1</a></td><td><a href="/files/ce2fcc1f46a3508514a7d060a4e491b267122a78">/files/ce2fcc1f46a3508514a7d060a4e491b267122a78</a></td><td><a href="/files/ce2fcc1f46a3508514a7d060a4e491b267122a78">/files/ce2fcc1f46a3508514a7d060a4e491b267122a78</a></td><td><a href="/files/5b3a3a1b0ddc6cf8d5c6db411c5b6507a0880de5">/files/5b3a3a1b0ddc6cf8d5c6db411c5b6507a0880de5</a></td></tr><tr><td>使用 AWS 配置子目录</td><td><a href="/pages/9c9d16af0d96bb11443d75f8e23ced8b3171c385">/pages/9c9d16af0d96bb11443d75f8e23ced8b3171c385</a></td><td><a href="/files/4f6a60aba42d0386aa8becbcf063b21e76fe031f">/files/4f6a60aba42d0386aa8becbcf063b21e76fe031f</a></td><td></td><td><a href="/files/69a6ffe04a98fc7742a394d2ab90f33541e48936">/files/69a6ffe04a98fc7742a394d2ab90f33541e48936</a></td><td><a href="/files/dacf3d834abc53a1daeefe469bbf2d47f2c9acaa">/files/dacf3d834abc53a1daeefe469bbf2d47f2c9acaa</a></td></tr></tbody></table>


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
