Skip to content
VercelLogotypeVercelLogotype
LoginSign Up

Rewrite docs to Mintlify

Learn how to rewrite the /docs path on your domain to Mintlify, a popular documentation platform.

DeployView Demo

Mintlify docs rewrite (vercel.ts) example

This template demonstrates how to serve Mintlify-hosted documentation from your main domain using Vercel's vercel.ts configuration. Instead of linking to docs.yourdomain.com or an external URL, your docs are seamlessly integrated at /docs on your product site.

The demo shows a fictional product site ("Flux") with docs hosted on Mintlify but served from the main domain for a unified user experience.

Demo

https://mintlify-docs-rewrite.vercel.app/

Visit the docs at /docs to see the Mintlify-hosted site served through the main domain.

How to Use

You can choose from one of the following two methods to use this repository:

One-Click Deploy

Deploy the example using Vercel:

Clone and Deploy

Execute create-next-app with npm or Yarn to bootstrap the example:

pnpm create next-app --example https://github.com/vercel/examples/tree/main/cdn/mintlify-docs-rewrite

Next, run Next.js in development mode:

pnpm dev

Environment variables

  • MINTLIFY_DOCS_URL – Your Mintlify custom domain URL (e.g., https://your-subdomain.mintlify.dev)

Set this in your Vercel project settings or in a .env.local file.

How it works

  1. You configure a custom domain in Mintlify (e.g., your-subdomain.mintlify.dev)
  2. vercel.ts exports a config with rewrite rules that map /docs and /docs/:match* to your Mintlify URL
  3. Vercel applies these rewrites at the edge, transparently proxying requests to Mintlify while preserving the original URL in the browser
  4. Users visit yourdomain.com/docs and see your Mintlify documentation as if it's part of your main site

Key benefits

  • Better SEO: Docs are on your main domain, not a separate subdomain
  • No CORS issues: Content is served from your domain
  • Seamless branding: Consistent experience across product and docs
  • Simple setup: Just add environment variable and deploy
  • Mintlify handles infrastructure: Focus on content while Mintlify manages hosting, CDN, and updates
GitHub
Ownervercel
Repositoryexamples
Use Cases
CDN
Multi-Tenant Apps
Stack
Next.js
Tailwind

Related Templates

Next.js Boilerplate

Get started with Next.js and React in seconds.
Next.js Boilerplate thumbnail

eve Chat Template

A persisted Next.js chat template for eve, built with shadcn/ui, Tailwind CSS, Streamdown, Better Auth, Drizzle, and Neon.
eve Chat Template thumbnail

Image Gallery Starter

An image gallery built on Next.js and Vercel Blob.
Image Gallery Starter thumbnail

Agent Stack

  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • eveNew
  • ConnectNew

Core Platform

  • CI/CD
  • Content Delivery
  • Fluid Compute
  • Observability

Security

  • Platform Security
  • WAF
  • Bot Management
  • Bot ID

Tools

  • Vercel DropNew
  • Vercel Agent
  • Vercel PluginNew
  • Agent Skills
  • Next.js
  • Domains
  • v0

Frameworks

  • eveNew
  • Nuxt
  • SvelteKit
  • Nitro
  • Turborepo
  • Tanstack Start
  • FastAPI
  • xmcp
  • All frameworks

SDKs

  • Vercel SDK
  • Workflow SDKNew
  • Flags SDK
  • Chat SDKNew
  • Queues SDKNew
  • Streamdown

Build

  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce
  • Platform Engineers
  • Design Engineers

Learn

  • Docs
  • Blog
  • Changelog
  • Knowledge Base
  • Academy
  • Articles
  • Community

Explore

  • Customers
  • Marketplace
  • Templates
  • Partner Finder
  • Vercel + AWS

Company

  • About
  • Careers
  • Press
  • Events
  • Startups
  • Shipped on Vercel
  • Open Source Program
  • Enterprise
  • Pricing
  • Help

Legal & Trust

  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • DPA
  • Acceptable Use Policy
  • Legal (all documents)
  • Trust Center
  • Status

Social

  • GitHub
  • X
  • LinkedIn
  • YouTube
  • Instagram
  • VercelVercel
Agent Stack
  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • eve
Core Platform
  • Security
  • Content Delivery
  • Fluid Compute
  • Observability
  • CI/CD
Tools
  • Next.js
  • Vercel Agent
  • Vercel Plugin
  • Domains
  • v0
Learn
  • Docs
  • About
  • Blog
  • Changelog
  • Knowledge Base
Build
  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce
Explore
  • Customers
  • Marketplace
  • Partner Finder
  • AWS
  • Community
EnterprisePricing
Contact
Log InSign Up
Dashboard

Products

Agent Stack

  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • eve

Core Platform

  • Security
  • Content Delivery
  • Fluid Compute
  • Observability
  • CI/CD

Tools

  • Next.js
  • Vercel Agent
  • Vercel Plugin
  • Domains
  • v0
Resources

Learn

  • Docs
  • About
  • Blog
  • Changelog
  • Knowledge Base

Build

  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce

Explore

  • Customers
  • Marketplace
  • Partner Finder
  • AWS
  • Community
Enterprise
Pricing
Sign UpLog In
Contact
DeployView Demo

Loading status…

Select a display theme: