Repository navigation
docs: Add trailing slashes to internal links to avoid redirects - #19639
Merged
coolguyzone merged 5 commits intoSep 29, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
coolguyzone
force-pushed
the
coolguyzone/chore/fix-trailing-slash-inlinks
branch
from
September 28, 2026 18:59
294ac31 to
a952706
Compare
coolguyzone
added a commit
that referenced
this pull request
Sep 28, 2026
The linter only matched targets starting with `/`, so it silently enforced half the rule. Relative links resolve in the browser against the current page and are requested verbatim, so a missing slash is still a 308: docs.sentry.io renders `href="../tags"` today, and that request 308s to the canonical `.../tags/`. The gap was larger than the bucket already fixed in #19639. Across docs/, includes/ and platform-includes/ the link forms are: 5364 absolute /foo (was covered) 4247 external http(s) (correctly ignored) 2385 relative ../foo ./foo (was NOT covered) 864 bare anchor #foo (correctly ignored) 84 bare relative foo/bar (was NOT covered) Matching those raises the repo-wide count from 1088 to 2189. Tightening the pattern mattered as much as widening it. A bare-relative branch that accepts any non-scheme text also matches an angle-bracket autolink whose URL contains parentheses -- ``[`main()`](<https://…/main(_:)>)`` -- and appending a slash there corrupts the URL. Site paths never contain `(`, `<` or `>`, so those are excluded from the path characters, which removed all 15 such false positives. Protocol-relative `//host` is exempted too, since it is external rather than a site path. Verified: `--fix` over the whole corpus changes 2189 links across 475 files with zero non-slash content changes, zero slash removals and zero external URLs altered. Resolved relative destinations spot-checked against production all return 200. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 28, 2026
…ix-trailing-slash-inlinks # Conflicts: # docs/platforms/python/integrations/index.mdx # docs/product/agents/getting-started.mdx # docs/product/issues/issue-details/index.mdx
The three files that conflicted were resolved with master's version, so the trailing-slash pass is re-run over them here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
coolguyzone
enabled auto-merge (squash)
September 29, 2026 18:04
coolguyzone
deleted the
coolguyzone/chore/fix-trailing-slash-inlinks
branch
September 29, 2026 18:17
This was referenced Sep 29, 2026
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.NOTE: This work was created programmatically using Claude, I have gone through and verified that these changes make sense and scanned the list of changes, they are all correctly adding trailing slashes to internal links. I am also working on a follow-up PR to auto-fix this issue on new PRs so we don't create new redirect hops.
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;url=: 184 vs 76).docs/,includes/andplatform-includes/<Link>,<PlatformLink to="...">and theurl=attribute on<LinkWithPlatformIcon>/cli/configuration#configuration-file→/cli/configuration/#configuration-file/pdfs/*.pdf, images) and API endpoints are left aloneincludePath,path,endpoint, env vars in code samples) are left aloneDeliberately left alone
Versioned pages (
__vX.Y.Z) invert the rule — they serve200without a trailing slash and308with one, so adding a slash would add a hop instead of removing one:Links with a query string whose path already ends in a slash, e.g.
/platform-redirect/?next=%2Ftracing%2F. The slash belongs on the path, not on the query value:Verification
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.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