Skip to content

Document first-match-wins behavior for redirects #5573

Merged
devalog merged 2 commits into
mainfrom
fern/redirects-first-match-docs
May 20, 2026
Merged

Document first-match-wins behavior for redirects #5573
devalog merged 2 commits into
mainfrom
fern/redirects-first-match-docs

Conversation

@fern-api
Copy link
Copy Markdown
Contributor

@fern-api fern-api Bot commented May 20, 2026

Adds a 'Match order' section to the redirects documentation explaining that redirects are evaluated top-to-bottom with the first matching rule taking precedence. Includes a code example showing how to order specific patterns before broader catch-all patterns.

Updates applied to all three snippet copies (English, Chinese translation, and root-level snippet).

Requested by: Fern Support

@fern-api fern-api Bot requested a review from devalog as a code owner May 20, 2026 18:04
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

@fern-api
Copy link
Copy Markdown
Contributor Author

fern-api Bot commented May 20, 2026

Requested by: devin
Slack thread: View conversation



## Redirects
Redirects map old URLs to new ones so inbound links and search rankings survive when pages move, change slugs, or are deleted.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated

```yml
redirects:
# Exact path redirects
- source: "/old-path"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated

# Exact path redirects
- source: "/old-path"
destination: "/new-path"
- source: "/old-folder/path"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated

destination: "/new-path"
- source: "/old-folder/path"
destination: "/new-folder/path"
- source: "/old-folder/path"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated

@@ -0,0 +1,11 @@
<ParamField path="source" type="string" required={true}>
您要重定向的相对路径(例如,`/old-path`)。必须是相对路径,而不是绝对 URL。不能包含搜索参数(例如,`?key=value`)。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated

```yml
redirects:
# 精确路径重定向
- source: "/old-path"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated

# 精确路径重定向
- source: "/old-path"
destination: "/new-path"
- source: "/old-folder/path"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated

destination: "/new-path"
- source: "/old-folder/path"
destination: "/new-folder/path"
- source: "/old-folder/path"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated

@devalog devalog merged commit 309d114 into main May 20, 2026
4 checks passed
@devalog devalog deleted the fern/redirects-first-match-docs branch May 20, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant