Skip to main content
When you change the path of a file in your docs folder, it also changes the URL path to that page. This may happen when restructuring your docs or changing the sidebar title.

Redirects

Set up 301 redirects by adding the redirects field to your docs.json file.
"redirects": [
  {
    "source": "/source/path",
    "destination": "/destination/path"
  }
]
This permanently redirects /source/path to /destination/path so that you don’t lose any previous SEO for the original page.

Wildcard redirects

To match a wildcard path, use * after a parameter. In this example, /beta/:slug* matches /beta/introduction and redirects it to /v2/introduction.
"redirects": [
  {
    "source": "/beta/:slug*",
    "destination": "/v2/:slug*"
  }
]

Partial wildcard redirects

Use partial wildcards to match URL segments that start with a specific prefix.
"redirects": [
  {
    "source": "/articles/concepts-*",
    "destination": "/collections/overview"
  }
]
This matches any URLs with the /articles/concepts- path, such as /articles/concepts-getting-started and /articles/concepts-overview, and redirects them all to /collections/overview. You can also substitute the captured wildcard value in the destination.
"redirects": [
  {
    "source": "/old/article-*",
    "destination": "/new/article-*"
  }
]
This redirects /old/article-123 to /new/article-123, preserving the captured value after the prefix.

Avoid infinite redirects

To avoid infinite loops, the destination slug cannot match the source slug. For example, if your docs are hosted at /docs, avoid:
"redirects": [
  {
    "source": "/docs/:slug*",
    "destination": "/:slug*"
  }
]
Find broken links with the CLI.
mint broken-links