|
1 | 1 | --- |
2 | 2 | title: "Vercel" |
3 | | -description: "Host documentation at a /docs subpath using Vercel" |
| 3 | +description: "Host documentation at a subpath using Vercel" |
4 | 4 | --- |
5 | 5 |
|
6 | | -## vercel.json Configuration |
| 6 | +ffdsafdsafd |
7 | 7 |
|
8 | | -To host your documentation at a custom subpath using Vercel, you need to add the |
9 | | -following configuration to your `vercel.json` file. |
| 8 | +<Steps> |
| 9 | + <Step title="Move your docs files"> |
| 10 | + Edit your file structure so that all your files are within a folder which is your custom subpath. So if you want to host your docs at [my-cool-custom-domain.com/docs](http://my-cool-custom-domain.com/docs) you would do the following: |
10 | 11 |
|
11 | | -```json |
12 | | -{ |
13 | | - "rewrites": [ |
14 | | - { |
15 | | - "source": "/docs", |
16 | | - "destination": "https://[subdomain].mintlify.dev/docs" |
17 | | - }, |
| 12 | + ``` |
| 13 | + /docs |
| 14 | + introduction.mdx |
| 15 | + navigation.mdx |
| 16 | + docs.json |
| 17 | + ``` |
| 18 | + </Step> |
| 19 | + <Step title="Configure your vercel.json"> |
| 20 | + In your main website add the following rewrites to your `vercel.json` |
| 21 | + |
| 22 | + ```json |
18 | 23 | { |
19 | | - "source": "/docs/:match*", |
20 | | - "destination": "https://[subdomain].mintlify.dev/docs/:match*" |
| 24 | + "rewrites": [ |
| 25 | + { |
| 26 | + "source": "/api/request", |
| 27 | + "destination": "https://hahnbeeyeet.mintlify.app/api/request" |
| 28 | + }, |
| 29 | + { |
| 30 | + "source": "/custom/subdirectory", |
| 31 | + "destination": "https://hahnbeeyeet.mintlify.app" |
| 32 | + }, |
| 33 | + { |
| 34 | + "source": "/custom/subdirectory/llms.txt", |
| 35 | + "destination": "https://hahnbeeyeet.mintlify.app/llms.txt" |
| 36 | + }, |
| 37 | + { |
| 38 | + "source": "/custom/subdirectory/llms-full.txt", |
| 39 | + "destination": "https://hahnbeeyeet.mintlify.app/llms-full.txt" |
| 40 | + }, |
| 41 | + { |
| 42 | + "source": "/custom/subdirectory/sitemap.xml", |
| 43 | + "destination": "https://hahnbeeyeet.mintlify.app/sitemap.xml" |
| 44 | + }, |
| 45 | + { |
| 46 | + "source": "/custom/subdirectory/robots.txt", |
| 47 | + "destination": "https://hahnbeeyeet.mintlify.app/robots.txt" |
| 48 | + }, |
| 49 | + { |
| 50 | + "source": "/custom/subdirectory/:path*", |
| 51 | + "destination": "https://hahnbeeyeet.mintlify.app/custom/subdirectory/:path*" |
| 52 | + }, |
| 53 | + { |
| 54 | + "source": "/mintlify-assets/:path+", |
| 55 | + "destination": "https://hahnbeeyeet.mintlify.app/mintlify-assets/:path+" |
| 56 | + } |
| 57 | + ] |
21 | 58 | } |
22 | | - ] |
23 | | -} |
24 | | -``` |
| 59 | + ``` |
| 60 | + </Step> |
| 61 | +</Steps> |
25 | 62 |
|
26 | 63 | <Note> |
27 | 64 | For more information, you can also refer to Vercel's offical guide on |
28 | 65 | rewrites: [Project Configuration: |
29 | 66 | Rewrites](https://vercel.com/docs/projects/project-configuration#rewrites) |
30 | | -</Note> |
| 67 | +</Note> |
0 commit comments