Skip to content

Close the redirect gaps the retired-tree redirects left - #481

Open
eugenia-scandit wants to merge 1 commit into
mainfrom
fix/redirect-gaps
Open

eugenia-scandit wants to merge 1 commit into
mainfrom
fix/redirect-gaps

Conversation

@eugenia-scandit

Copy link
Copy Markdown
Collaborator

Summary

Old URLs that still 404 after the retired-tree redirects:

  • /stable/... and /<root version>/... (for example /8.6.1/...): a second postBuild pass writes a redirect page for every root route. Path-for-path redirects are written first and win.
  • Hosted pages under a frozen patch (/7.6.5/hosted/..., /6.28.2/hosted/...) with no twin in the frozen tree now go to the current page.
  • Version prefixes the site never served (/6.18/..., /7.5/..., /5.0/sdks/...): the 404 page moves them to the tree serving that major, or to the root. Hosted paths go to the frozen tree's page when it has one, else the current one, checked against the app's routes.
  • Bug fix: the API-reference fallback read the router's path, which drops .html, so /7.6.6/.../vin.html went to /7.6/.../vin and 404ed again. It now reads the URL as requested.

Fallback redirects keep the query string and anchor. Preview builds skip the root redirect pass.

Test plan

  • npm run build passes
  • Generated pages checked: /7.6.5/hosted/id-bolt/overview/ → current page; /7.6.4/hosted/express/... → its 7.6.15 twin; /stable/sdks/linux/add-sdk/ and /8.6.1/ → root
  • Table test of the 404 rules for ~35 old URLs: every chain ends on a page or a 404, no loops
  • Checked in a browser against an S3-like local server: /7.6.6/.../vin.html, /6.18/sdks/ios/core-concepts/, /5.0/sdks/ios/release-notes/

🤖 Generated with Claude Code

Old URLs that still 404 after the retired-tree redirects:

- /stable/... and /<root version>/... (for example /8.6.1/...): the root
  docs carry no version prefix. A second postBuild pass writes redirect
  pages for every root route; path-for-path redirects are written first
  and win.
- Hosted pages under a frozen patch (/7.6.5/hosted/..., /6.28.2/hosted/...)
  with no twin in the frozen tree: redirected to the current page.
- Version prefixes the site never served (/6.18/..., /7.5/..., /5.0/sdks/...):
  the 404 page moves them to the tree serving that major, or to the root.
  Hosted paths go to the frozen tree's page when it has one, else the
  current one, checked against the app's routes so the target renders.
- The API-reference fallback read the router's path, which drops ".html",
  so /7.6.6/.../vin.html went to /7.6/.../vin and 404ed again. It now
  reads the URL as requested.

Fallback redirects keep the query string and anchor. API-reference paths
are left out of the unserved-version rule, which would otherwise bounce
between the two. Preview builds, whose base URL is not the root, skip the
root redirect pass.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://Scandit.github.io/data-capture-documentation/pr-preview/pr-481/

Built to branch gh-pages at 2026-10-12 13:33 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant