# 设置自定义子目录

使用自定义子目录，你可以将你的文档站点访问地址设为 `example.com/docs`。这与 [自定义域名](https://gitbook-open-v2-preview.gitbook.workers.dev/url/gitbook.com/docs/documentation/zh/publishing-documentation/custom-domain) 不同，后者可让你的文档站点访问地址设为 `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="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%2FGYtERTwSsUtqY1crFSnk%2FCloudflare.png?alt=media&#x26;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&#x26;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&#x26;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&#x26;token=0f117eb3-2270-48c5-b622-e971374b7a5a">25_12_10_cloudflare.png</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%2F6vihVGnoaGJIK47oiPIt%2FVercel.png?alt=media&#x26;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&#x26;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&#x26;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&#x26;token=6719d901-d0d4-4eeb-9569-faa0607cefd6">25_12_10_vercel.png</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%2FYf6n0ahpdjIA7b9Jba2N%2FAWS.png?alt=media&#x26;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&#x26;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&#x26;token=36b45c4e-0c33-47aa-b73c-5f59fd0649ff">25_12_10_aws.png</a></td></tr></tbody></table>
