fix(seo): trailing-slash redirect variants for bare docs paths#245
Merged
Conversation
Vercel's trailingSlash:true rewrites /foo → /foo/ before evaluating redirects, so bare-path redirect rules like /concepts/:path* never fire. The trailing-slash redirect intercepts first, then /concepts/arbitrage/ doesn't match any redirect → 404. Adds trailing-slash source variants for all exact-match redirects and section index paths. Also adds redirects for /me and /value-bets which GSC reported as 404s. Fixes 5 GSC redirect errors + ~5 of the 19 GSC 404s. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
Author
|
Merge gate (auto-classified): gate=smoke-passed — auto-classified by the gate-log enforcer (12min after merge, no Posted by |
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.
Summary
/quickstart/→/en/quickstart/)/en/api-reference/→/en/api-reference/overview/)/meand/value-betswhich GSC reported as 404strailingSlash: truerewrites/foo→/foo/before evaluating redirects, so bare-path rules never fired — the trailing-slash version 404d instead of redirecting to/en/...Impact
Test plan
curl -sIL https://docs.sharpapi.io/concepts/arbitrage→ should 301 to/en/concepts/arbitrage/(was 308 → 404)curl -sIL https://docs.sharpapi.io/quickstart→ should 301 to/en/quickstart/(was 308 → 404)curl -sIL https://docs.sharpapi.io/en/api-reference/→ should 301 to/en/api-reference/overview/(was 404)curl -sIL https://docs.sharpapi.io/me→ should 301 to/en/(was 308 → 404)🤖 Generated with Claude Code