> 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/ja-gitbook-documentation/publish/custom-domain/setting-a-custom-subdirectory.md).

# カスタムサブディレクトリの設定

ドキュメントサイトにカスタムサブディレクトリを設定します

カスタムサブディレクトリを設定すると、ドキュメントサイトに次の URL でアクセスできるようになります `example.com/docs`。これは、ドキュメントサイトに次の URL でアクセスできるようにする [カスタムドメイン](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/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="https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/custom-domain/setting-a-custom-subdirectory/configuring-a-subdirectory-with-cloudflare.md">Cloudflare でサブディレクトリを設定する</a></td><td><a href="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-32cb84953ba8480b5ae6e8d7ba3c15bb99ba5515%2F25_12_10_cloudflare_1.png?alt=media">25_12_10_cloudflare_1.png</a></td><td><a href="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-94038beaa9dbd63c36f8356c6d9e615d5a2f8695%2F25_08_29_cloudflare.svg?alt=media">25_08_29_cloudflare.svg</a></td><td><a href="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-94038beaa9dbd63c36f8356c6d9e615d5a2f8695%2F25_08_29_cloudflare.svg?alt=media">25_08_29_cloudflare.svg</a></td><td><a href="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-d47f749f6e54b052107ff69213062d200277141a%2F25_12_10_cloudflare.png?alt=media">25_12_10_cloudflare.png</a></td></tr><tr><td>Vercel でサブディレクトリを設定する</td><td><a href="https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/custom-domain/setting-a-custom-subdirectory/configuring-a-subdirectory-with-vercel.md">Vercel でサブディレクトリを設定する</a></td><td><a href="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-8ca2e012313920280fe5ebe899aac70897a3b332%2F25_12_10_vercel_1.png?alt=media">25_12_10_vercel_1.png</a></td><td><a href="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-524d4b64d26d00a6b8339dc72e4c70c94e55cab8%2F25_08_29_vercel.svg?alt=media">25_08_29_vercel.svg</a></td><td><a href="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-524d4b64d26d00a6b8339dc72e4c70c94e55cab8%2F25_08_29_vercel.svg?alt=media">25_08_29_vercel.svg</a></td><td><a href="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-5fd92243209604a04bb98e8443394097d9275e5c%2F25_12_10_vercel.png?alt=media">25_12_10_vercel.png</a></td></tr><tr><td>AWS でサブディレクトリを設定する</td><td><a href="https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/custom-domain/setting-a-custom-subdirectory/configuring-a-subdirectory-with-aws.md">CloudFront と Route 53 を使って AWS でサブディレクトリを設定する</a></td><td><a href="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-66971db2b81134b71d3013997be7ce238947573e%2F25_12_10_aws_1.png?alt=media">25_12_10_aws_1.png</a></td><td></td><td><a href="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-67500bf2e3269759cf682323ab95fa5da01e4113%2F25_10_23_aws.png?alt=media">25_10_23_aws.png</a></td><td><a href="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-d976ddd76d73f519c2f534437e67dd5da732c124%2F25_12_10_aws.png?alt=media">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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/custom-domain/setting-a-custom-subdirectory.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
