Skip to content

fix(seo): canonicalize dotted documentation routes - #19302

Open
sfanahata wants to merge 1 commit into
masterfrom
fix/canonical-dotted-routes
Open

fix(seo): canonicalize dotted documentation routes#19302
sfanahata wants to merge 1 commit into
masterfrom
fix/canonical-dotted-routes

Conversation

@sfanahata

@sfanahata sfanahata commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

DESCRIBE YOUR PR

Fixes non-indexable canonical targets for documentation routes whose final segment contains a dot, including Java and Python migration guides such as 7.x-to-8.0 and 1.x-to-2.x.

With trailingSlash: true, Next.js treats final segments ending in .<word characters> as file-like. Their direct URL has no trailing slash, while the slash form redirects to it. Canonical metadata previously always appended /, so these pages pointed their canonical tag at a redirect.

This PR adds one shared canonicalPath helper that mirrors Next.js route normalization and uses it for:

  • HTML canonical metadata
  • Sitemap URLs
  • Canonical Link headers on .md responses
  • Custom canonical paths

Ordinary documentation routes continue to use trailing slashes. Dotted migration and versioned routes use the direct no-slash form. This supersedes #19004 without its broad content-link or unrelated MD-export changes.

Verification

  • pnpm test:ci: 377 tests passed
  • pnpm lint:eslint: 0 errors (9 existing warnings)
  • pnpm lint:prettier: passed
  • pnpm lint:ts: passed
  • Next production compilation completed locally; the full Vercel production build passed
  • Local HTTP verification confirmed:
    • Java and Python dotted routes return 200 and are self-canonical without /
    • Their slash forms return 308 to the no-slash URL
    • An ordinary docs route returns 200 and is self-canonical with /
    • Sitemap and .md canonical headers use the same route-aware forms

IS YOUR CHANGE URGENT?

  • Urgent deadline (GA date, etc.)
  • Other deadline
  • None: Not urgent, can wait up to 1 week+

PRE-MERGE CHECKLIST

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

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
develop-docs Ready Ready Preview Sep 8, 2026 11:07pm UTC
sentry-docs Ready Ready Preview Sep 8, 2026 11:07pm UTC

Request Review

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