docs: Add trailing slashes to internal links to avoid redirects - #19639
Open
coolguyzone wants to merge 1 commit into
Open
coolguyzone wants to merge 1 commit into
coolguyzone wants to merge 1 commit into
Conversation
next.config.ts sets `trailingSlash: true`, so any internal link written without a trailing slash is served a 308 before the page loads. This normalizes those links so they resolve directly, removing a redirect hop on each one. Covers 777 links across 369 files in docs/, includes/ and platform-includes/, spanning markdown links, <Link> and <PlatformLink to="...">. Anchors are handled correctly (/cli/configuration#foo -> /cli/configuration/#foo). This also aligns the links with the repo's dominant convention: before this change markdown links were already 3197 with a slash vs 248 without, and PlatformLink 931 vs 376. Versioned pages (__vX.Y.Z) are deliberately excluded. They serve 200 without a trailing slash and 308 with one, so adding a slash there would add a hop rather than remove one. Verified: all 177 distinct absolute destinations resolve on docs.sentry.io (168 -> 200; 9 -> pre-existing moved-page redirects that this change shortens rather than introduces). Every changed file differs from origin/master only by added "/" characters, with no slash removed anywhere. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DESCRIBE YOUR PR
Follow-up to #19636.
next.config.tssetstrailingSlash: true, so every internal link written without a trailing slash is served a 308 redirect before the page loads. This normalizes those links so they resolve directly, removing one redirect hop each.This is also a consistency fix — trailing slashes were already the dominant convention in this repo before this change (markdown links: 3,197 with vs 248 without;
<PlatformLink>: 931 vs 376).docs/,includes/andplatform-includes/<Link>, and<PlatformLink to="...">/cli/configuration#configuration-file→/cli/configuration/#configuration-file/pdfs/*.pdf, images) and API endpoints are left aloneVersioned pages (
__vX.Y.Z) are deliberately excluded. They behave the opposite way — they serve200without a trailing slash and308with one, so adding a slash there would add a hop instead of removing one:Verification
200, 9 → pre-existing moved-page redirects that this change shortens rather than introduces (those are docs: Point internal links directly at moved-page destinations #19636's territory). Zero 404s.origin/masteronly by added/characters — no slash is removed anywhere and no other content is touched.<PlatformLink>paths are platform-relative, so only the suffix changed; resolution logic is untouched.lint-404slocally —pnpm buildfails on this machine for an unrelated pre-existing dependency issue (@sentry/nextjs./configsubpath not exported when loadingnext.config.ts). Please confirm the CI 404 check is green before merging.Noted, not fixed (follow-ups)
/security-legal-pii/scrubbing//server-side-scrubbing/)develop-docs/has ~250 of the same trailing-slash cases; it's a separate site, so it's left for its own PRIS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
Select exactly one option. For deadlines, replace
YYYY-MM-DDwith the due date. You can update this information later by editing the PR description.SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
🤖 Generated with Claude Code