From 8f0226dddd4b2645cc8f84b0278f4046b4ce026e Mon Sep 17 00:00:00 2001 From: Leyland Yang <105257885+yangleyland@users.noreply.github.com> Date: Thu, 18 Dec 2025 09:11:46 -0800 Subject: [PATCH] Update create/redirects.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> --- create/redirects.mdx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/create/redirects.mdx b/create/redirects.mdx index c084c5440..7a79858f4 100644 --- a/create/redirects.mdx +++ b/create/redirects.mdx @@ -21,6 +21,8 @@ Set up 301 redirects by adding the `redirects` field to your `docs.json` file. This permanently redirects `/source/path` to `/destination/path` so that you don't lose any previous SEO for the original page. +### Wildcard paths + To match a wildcard path, use `*` after a parameter. In this example, `/beta/:slug*` matches `/beta/introduction` and redirects it to `/v2/introduction`. ```json @@ -32,6 +34,36 @@ To match a wildcard path, use `*` after a parameter. In this example, `/beta/:sl ] ``` +### Partial wildcard patterns + +Use partial wildcards to match URL segments that start with a specific prefix. Add `*` at the end of a prefix to match any content that follows. + +For example, `/en/articles/9140627-*` matches any path where the segment starts with `9140627-`: + +```json +"redirects": [ + { + "source": "/en/articles/9140627-*", + "destination": "/collections/overview" + } +] +``` + +This redirects paths like `/en/articles/9140627-how-do-i-create-collections` and `/en/articles/9140627-what-is-a-collection` to `/collections/overview`. + +You can also substitute the captured portion in the destination by using the same partial wildcard pattern: + +```json +"redirects": [ + { + "source": "/old/article-*", + "destination": "/new/article-*" + } +] +``` + +This redirects `/old/article-123` to `/new/article-123`, preserving the `123` portion after the prefix. + ## Broken links Catch broken links with our CLI. [Install the CLI](/installation) and run the command: