Document first-match-wins behavior for redirects #5573
Conversation
|
🌿 Preview your docs: https://fern-preview-fern-redirects-first-match-docs.docs.buildwithfern.com/learn Here are the markdown pages you've updated: |
|
Requested by: devin |
|
|
||
|
|
||
| ## Redirects | ||
| Redirects map old URLs to new ones so inbound links and search rankings survive when pages move, change slugs, or are deleted. |
There was a problem hiding this comment.
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated
| ```yml | ||
| redirects: | ||
| # Exact path redirects | ||
| - source: "/old-path" |
There was a problem hiding this comment.
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated
| # Exact path redirects | ||
| - source: "/old-path" | ||
| destination: "/new-path" | ||
| - source: "/old-folder/path" |
There was a problem hiding this comment.
[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" |
There was a problem hiding this comment.
[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`)。 | |||
There was a problem hiding this comment.
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated
| ```yml | ||
| redirects: | ||
| # 精确路径重定向 | ||
| - source: "/old-path" |
There was a problem hiding this comment.
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated
| # 精确路径重定向 | ||
| - source: "/old-path" | ||
| destination: "/new-path" | ||
| - source: "/old-folder/path" |
There was a problem hiding this comment.
[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" |
There was a problem hiding this comment.
[FernStyles.Current] Avoid time-relative terms like 'old' that become outdated
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