Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 40 additions & 9 deletions create/redirects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
]
```

This permanently redirects `/source/path` to `/destination/path` so that you don't lose any previous SEO for the original page.

Check warning on line 22 in create/redirects.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

create/redirects.mdx#L22

Spell out 'SEO', if it's unfamiliar to the audience.

### 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`.

```json
Expand All @@ -32,22 +34,51 @@
]
```

<Warning>
The destination slug cannot match to the source slug. For example, if your docs are hosted at `/docs`, avoid:
```json
### Partial wildcard redirects

Use partial wildcards to match URL segments that start with a specific prefix.

```json
"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.

```json
"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:

Check warning on line 67 in create/redirects.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

create/redirects.mdx#L67

Use 'can't' instead of 'cannot'.

Check warning on line 67 in create/redirects.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

create/redirects.mdx#L67

In general, use active voice instead of passive voice ('are hosted').

```json
"redirects": [
{
"source": "/docs/:slug*",
"destination": "/:slug*"
}
```
</Warning>
]
```

## Broken links
## Check for broken links

Catch broken links with our CLI. [Install the CLI](/installation) and run the command:
Find broken links with the [CLI](/installation).

```bash
mint broken-links
```

The CLI identifies any relative links in your docs that don't exist.