Skip to content

docs: Add trailing slashes to internal links to avoid redirects - #19639

Open
coolguyzone wants to merge 1 commit into
masterfrom
coolguyzone/chore/fix-trailing-slash-inlinks
Open

coolguyzone wants to merge 1 commit into
masterfrom
coolguyzone/chore/fix-trailing-slash-inlinks

Conversation

@coolguyzone

Copy link
Copy Markdown
Contributor

DESCRIBE YOUR PR

Follow-up to #19636. next.config.ts sets trailingSlash: 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).

  • 777 links across 369 files in docs/, includes/ and platform-includes/
  • Covers markdown links, <Link>, and <PlatformLink to="...">
  • Anchors handled correctly: /cli/configuration#configuration-file → /cli/configuration/#configuration-file
  • Links inside fenced code blocks, asset paths (/pdfs/*.pdf, images) and API endpoints are left alone

Versioned pages (__vX.Y.Z) are deliberately excluded. They behave the opposite way — they serve 200 without a trailing slash and 308 with one, so adding a slash there would add a hop instead of removing one:

/platforms/javascript/guides/aws-lambda/install/npm__v9.x   -> 200
/platforms/javascript/guides/aws-lambda/install/npm__v9.x/  -> 308

Verification

  • All 177 distinct absolute destinations were checked against production: 168 → 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.
  • Every changed file differs from origin/master only 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.
  • I could not run lint-404s locally — pnpm build fails on this machine for an unrelated pre-existing dependency issue (@sentry/nextjs ./config subpath not exported when loading next.config.ts). Please confirm the CI 404 check is green before merging.

Noted, not fixed (follow-ups)

  • ~21 pre-existing links to versioned pages that do carry a trailing slash (and so take a needless hop) — left alone here to keep this PR purely mechanical
  • A handful of pre-existing double-slash links (e.g. /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 PR

IS 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-DD with the due date. You can update this information later by editing the PR description.

  • Urgent deadline (GA date, etc.): YYYY-MM-DD
  • Other deadline: YYYY-MM-DD
  • No deadline: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've supplied a deadline.

Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-docs Ready Ready Preview Sep 25, 2026 10:54pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
develop-docs Ignored Ignored Sep 25, 2026 10:54pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview – sentry-docs — 294ac317 Deployed Sep 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Normal Docs review has no urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant