# Deploy at a subpath with Vercel (/deploy/vercel)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 723 · updated: 2026-07-30 -->
Related: [Host docs at a subpath](/deploy/docs-subpath.md), [Deploy at a subpath with Cloudflare Workers](/deploy/cloudflare.md), [Deploy at a subpath with AWS Route 53 and CloudFront](/deploy/route53-cloudfront.md), [Reverse proxy](/deploy/reverse-proxy.md), [Content Security Policy (CSP) configuration](/deploy/csp-configuration.md)

Configure your `vercel.json` file to proxy requests from your main domain to your documentation at a subpath.

## The vercel.json file [#the-verceljson-file]

The `vercel.json` file configures how your project builds and deploys. It sits in your project's root directory and controls various aspects of your deployment, including routing, redirects, headers, and build settings.

Mintlify uses the `rewrites` configuration in your `vercel.json` file to proxy requests from your main domain to your documentation.

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.site/docs`, but the user still sees `yoursite.com/docs` in their browser. This is different from redirects, which send users to another URL entirely.

## Configuration [#configuration]

### Host at `/docs` subpath [#host-at-docs-subpath]

1. Navigate to [Custom domain setup](https://app.mintlify.com/settings/deployment/custom-domain) in your dashboard.
2. Enable the **Host at** toggle.
3. Enter your domain.
4. Enter `docs` as your base path.
5. Click **Add domain**.
6. Add the following rewrites to your `vercel.json` file. Replace `[subdomain]` with your subdomain, which appears at the end of your dashboard URL. For example, `app.mintlify.com/your-organization/your-subdomain` has a domain identifier of `your-subdomain`.

   ```json
   {
     "rewrites": [
       {
         "source": "/docs",
         "destination": "https://[subdomain].mintlify.site/docs"
       },
       {
         "source": "/docs/:match*",
         "destination": "https://[subdomain].mintlify.site/docs/:match*"
       }
     ]
   }
   ```

The `rewrites` configuration maps the `/docs` subpath on your domain to the `/docs` subpath on your documentation.

* **`source`**: The path pattern on your domain that triggers the rewrite.
* **`destination`**: Where the request should be proxied to.
* **`:match*`**: A wildcard that captures any path segments after your subpath.

For more information, see [Configuring projects with vercel.json: Rewrites](https://vercel.com/docs/projects/project-configuration#rewrites) in the Vercel documentation.

### Host at custom subpath [#host-at-custom-subpath]

To use a custom subpath (any path other than `/docs`):

1. Navigate to the [Custom domain setup](https://app.mintlify.com/settings/deployment/custom-domain) page in your dashboard.
2. Enable the **Host at** toggle.
3. Enter your domain.
4. Enter your base path. For example, `/docs` or `/help`.
5. Click **Add domain**.

Then use the generator below to create your rewrites configuration and add the rewrites to your `vercel.json` file.

Mintlify rebuilds your documentation to serve at your base path, so your documentation files do not need to be in a directory that matches your subpath.
