# 设置自定义子目录

使用自定义子目录，您可以让您的文档站点通过以下地址访问 `example.com/docs`。这不同于 [自定义域名](https://gitbook-open-v2-preview.gitbook.workers.dev/url/gitbook.com/docs/documentation/zh/fa-bu-wen-dang/custom-domain) 它允许您让文档站点通过以下地址访问 `docs.example.com`.&#x20;

这样做的一个原因是可以使您的文档 URL 与其他站点 URL 保持一致的格式。使用子目录对 SEO 也可能有利。

要配置子目录，您需要在网站的后端进行设置，然后在您的 GitBook 站点设置中完成该过程。

<table data-card-size="large" 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-card-cover-dark data-type="image">封面图片（深色）</th></tr></thead><tbody><tr><td>使用 Cloudflare 配置子目录</td><td><a href="setting-a-custom-subdirectory/configuring-a-subdirectory-with-cloudflare">configuring-a-subdirectory-with-cloudflare</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FM0E8QF3gdMCdwHMl107b%2FCloudflare.svg?alt=media&#x26;token=6a04f0d2-cccb-4668-93d3-98c9ec3890a6">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&#x26;token=f4109747-5c4d-4039-8b33-168569f41d9d">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&#x26;token=f4109747-5c4d-4039-8b33-168569f41d9d">Cloudflare.svg</a></td></tr><tr><td>使用 Vercel 配置子目录</td><td><a href="setting-a-custom-subdirectory/configuring-a-subdirectory-with-vercel">configuring-a-subdirectory-with-vercel</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FItwcojUHfxkmx4RofP6F%2FVercel.svg?alt=media&#x26;token=9cd8279b-d1f9-41f0-97e7-4f9a4eaa4a14">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&#x26;token=e53c02a9-86fe-4ddc-8585-5cd0cef82ed4">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&#x26;token=e53c02a9-86fe-4ddc-8585-5cd0cef82ed4">Vercel.svg</a></td></tr><tr><td>使用 AWS 配置子目录</td><td><a href="setting-a-custom-subdirectory/configuring-a-subdirectory-with-aws">configuring-a-subdirectory-with-aws</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Frq7lwbUlUQK8AOujefPf%2FAWS%20-%20light.png?alt=media&#x26;token=914054bd-a225-41f3-8f11-ff421d86fdd6">AWS - light.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&#x26;token=ae589916-116d-4a29-8d59-985552addda5">AWS - dark.png</a></td></tr></tbody></table>
