You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deploy/vercel.mdx
+31-23Lines changed: 31 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,42 +11,50 @@ The `vercel.json` file configures how your project is built and deployed. It sit
11
11
12
12
We use the `rewrites` configuration to proxy requests from your main domain to your documentation.
13
13
14
-
Rewrites map incoming requests to different destinations without changing the URL in the browser. When someone visits `yoursite.com/docs`, Vercel will internally fetch content from `your-subdomain.mintlify.dev/docs` but the user will still see`yoursite.com/docs` in their browser. This is different from redirects, which would send users to a different URL entirely.
14
+
Rewrites map incoming requests to different destinations without changing the URL in the browser. When someone visits `yoursite.com/docs`, Vercel internally fetches content from `your-subdomain.mintlify.dev/docs`, but the user still sees`yoursite.com/docs` in their browser. This is different from redirects, which send users to another URL entirely.
15
15
16
16
You can customize the subpath to any value you prefer, such as `/docs`, `/help`, or `/guides`. Additionally, you can use deeply nested subpaths like `/product/docs`.
17
17
18
-
## Repository structure
19
-
20
-
Your documentation files must be organized within your repository to match your chosen subpath structure. For example, if you want your documentation at `yoursite.com/docs`, you would create a `docs/` directory with all of your documentation files.
21
-
22
18
## Configuration
23
19
24
-
To host your documentation at a custom subpath using Vercel, add the following configuration to your `vercel.json` file. This example uses `/docs`, but you can replace it with any subpath:
1. Navigate to [Custom domain setup](https://dashboard.mintlify.com/settings/deployment/custom-domain) in your dashboard.
23
+
2. Click the **Host at `/docs`** toggle to the on position.
24
+
<Frame>
25
+
<imgalt="Screenshot of the Custom domain setup page. The Host at `/docs` toggle is on and highlighted by an orange rectangle."src="/images/subpath/toggle-light.png"className="block dark:hidden" />
26
+
<imgalt="Screenshot of the Custom domain setup page. The Host at `/docs` toggle is on and highlighted by an orange rectangle."src="/images/subpath/toggle-dark.png"className="hidden dark:block" />
27
+
</Frame>
28
+
3. Enter your domain.
29
+
4. Select **Add domain**.
30
+
5. Add the following rewrites to your `vercel.json` file. Replace `[subdomain]` with your subdomain:
-**`source`**: The path pattern on your domain that triggers the rewrite.
42
48
-**`destination`**: Where the request should be proxied to.
43
49
-**`:match*`**: A wildcard that captures any path segments after your subpath.
44
50
45
51
For more information, see [Configuring projects with vercel.json: Rewrites](https://vercel.com/docs/projects/project-configuration#rewrites) in the Vercel documentation.
46
52
47
-
### Generate rewrites
53
+
### Host from custom path
54
+
55
+
To use a custom subpath (any path other than `/docs`), you must organize your documentation files within your repository to match your subpath structure. For example, if your documentation is hosted at `yoursite.com/help`, your documentation files must be in a `help/` directory.
48
56
49
-
Enter your subdomain and custom subdirectory to generate the rewrites for your `vercel.json` file.
57
+
Use the generator below to create your rewrites configuration. Add the rewrites to your `vercel.json` file.
0 commit comments