Redirects: allow an array of source paths for a single destination #6560
Darkforge317
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When consolidating legacy/renamed slugs, it's common to have many old paths that should all redirect to one canonical page. Today redirects in docs.json requires a separate object per source, so a single destination often spans many near-identical entries:
On a large docs site this makes the redirects block long, repetitive, and harder to review. Every canonical page ends up with a scattered cluster of one-line entries.
Proposed solution
Let source optionally accept an array of strings, as sugar for N entries sharing the same destination (and permanent):
Fully backward-compatible: a string source keeps working exactly as today; an array is purely additive.
Alternatives considered
Wildcard / pattern source (e.g. /:slug*) only helps when the stale slugs share a safe common pattern. For arbitrary renamed slugs they usually don't, and a broad prefix can accidentally match the destination page itself (creating a redirect loop) or unrelated live pages. So it's not a substitute for an explicit list.
Keeping one entry per source (today's behavior) works but scales poorly and hurts reviewability.
Impact
We maintain a docs site with a couple hundred pages and a steadily growing redirects list from renames and pre-migration URLs. Grouping sources under their destination would meaningfully shrink the config and make redirect intent easier to audit.
Confirmed with Mintlify support that there's no current way to do this, and they suggested filing here.
All reactions