Skip to content

docs(docs): add 301 redirects for retired cli-reference urls (#2179)#2197

Merged
bpamiri merged 1 commit into
developfrom
peter/fix-2179-cli-reference-redirects
Apr 22, 2026
Merged

docs(docs): add 301 redirects for retired cli-reference urls (#2179)#2197
bpamiri merged 1 commit into
developfrom
peter/fix-2179-cli-reference-redirects

Conversation

@bpamiri

@bpamiri bpamiri commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds Astro static redirects map to web/sites/guides/astro.config.mjs so the Phase 0 preview paths at /v4-0-0-snapshot/cli-reference/ (retired in #2169) redirect to the replacement tree at /v4-0-0-snapshot/command-line-tools/ instead of 404'ing.

Two concrete redirects:

  • /v4-0-0-snapshot/cli-reference/v4-0-0-snapshot/command-line-tools/
  • /v4-0-0-snapshot/cli-reference/info/v4-0-0-snapshot/command-line-tools/

Scope note — wildcard dropped

The triage plan called for a third [...slug] wildcard. Astro 5's static redirects map does not support [...spread] sources without a backing page that supplies getStaticPathsastro build fails with GetStaticPathsRequired when a spread-source redirect has no source file. The wildcard was removed; only the two documented Phase 0 URLs (index.mdx and info.mdx) are redirected. Deep-link URLs under /cli-reference/* (if any exist in the wild) will hit the site's standard 404 page rather than redirecting.

Status code note

Astro emits 308 Permanent Redirect on the dev server (wire-level) and meta-refresh HTML with canonical link in the static build output (which Cloudflare Pages serves as HTTP 200 with refresh tag). Both are SEO-equivalent for a permanent redirect. If strict wire-level 301s are ever required, a parallel public/_redirects file with Cloudflare-native syntax can be added later.

Closes #2179

Test plan

  • pnpm --filter @wheels-dev/site-guides build — compiles cleanly, 415 pages built, no warnings related to redirects
  • ls dist/v4-0-0-snapshot/cli-reference/ — confirms index.html and info/index.html exist with meta-refresh + canonical to /command-line-tools/
  • curl -sI http://localhost:4321/v4-0-0-snapshot/cli-reference on astro devHTTP/1.1 308 Permanent Redirect, location: /v4-0-0-snapshot/command-line-tools/
  • curl -sI http://localhost:4321/v4-0-0-snapshot/cli-reference/info on astro devHTTP/1.1 308 Permanent Redirect, location: /v4-0-0-snapshot/command-line-tools/
  • curl -sI http://localhost:4321/v4-0-0-snapshot/command-line-tools/HTTP/1.1 200 OK (regression check)
  • After deploy, verify Cloudflare Pages preview serves the same three URLs correctly

🤖 Generated with Claude Code

Phase 0 preview at /v4-0-0-snapshot/cli-reference/ was retired in
PR #2169 and replaced by /v4-0-0-snapshot/command-line-tools/. Add
Astro static redirects for the two documented Phase 0 URLs so
external bookmarks and crawler backlinks don't 404.

Astro's static redirects map does not support [...spread] sources
without a backing page (getStaticPaths is required), so the wildcard
catch-all from the triage plan was dropped. Only the two concrete
paths are redirected; deep-link URLs under /cli-reference/ will hit
the standard 404 page.

Verified locally via astro build (emits meta-refresh HTML at
dist/v4-0-0-snapshot/cli-reference/{index,info/index}.html with
canonical link pointing at the new tree) and astro dev (returns
HTTP 308 with correct Location header on the wire).

Closes #2179

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bpamiri
bpamiri merged commit 9189225 into develop Apr 22, 2026
8 checks passed
@bpamiri
bpamiri deleted the peter/fix-2179-cli-reference-redirects branch April 22, 2026 04:59
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.

v4 guides: add 301 redirects for pre-cutover URLs (cli-reference → command-line-tools)

1 participant