A comprehensive guide for managing redirects in Mintlify documentation (migrated from Nextra).
Redirects are essential when restructuring documentation (IA refactor) to ensure:
- Old links don't break
- Search engine rankings are preserved
- User bookmarks continue to work
- External links remain valid
Location: All Mintlify redirects are configured in /docs.json
Navigate to the root of the project and open /docs.json.
Look for the redirects section (around line 33):
{
"$schema": "https://mintlify.com/docs.json",
"theme": "mint",
"name": "Optimism Documentation",
...
"redirects": [
// Redirects go here
],
...
}Add a new object to the array:
{
"redirects": [
{
"source": "/old-page-path",
"destination": "/new-page-path"
}
]
}# Run the dev server
mint dev
# Test the redirect
# Navigate to http://localhost:3000/old-page-path
# Should redirect to /new-page-pathScenario: You renamed getting-started.mdx to quickstart.mdx
{
"source": "/getting-started",
"destination": "/quickstart"
}Scenario: Moved all tutorials from /docs/ to /tutorials/
{
"source": "/docs/deploy-contract",
"destination": "/tutorials/deploy-contract"
},
{
"source": "/docs/setup-wallet",
"destination": "/tutorials/setup-wallet"
},
{
"source": "/docs/bridge-tokens",
"destination": "/tutorials/bridge-tokens"
}Note: You need one redirect per page (no wildcards!)
Scenario: Moved app-developers/tools/supersim.mdx to interop/tools/supersim.mdx
{
"source": "/app-developers/tools/supersim",
"destination": "/interop/tools/supersim"
}Scenario: Deleted a page and want to redirect to a related page
{
"source": "/deprecated-feature",
"destination": "/new-feature-overview"
}Scenario: Moved content to external documentation
{
"source": "/old-specs",
"destination": "https://specs.optimism.io"
}Nextra (supported):
/docs/* /tutorials/:splat 301
Mintlify (NOT supported):
{
"source": "/docs/*",
"destination": "/tutorials/*"
}Workaround: Create individual redirects for each page:
{
"redirects": [
{ "source": "/docs/page1", "destination": "/tutorials/page1" },
{ "source": "/docs/page2", "destination": "/tutorials/page2" },
{ "source": "/docs/page3", "destination": "/tutorials/page3" }
]
}