docs(docs): add 301 redirects for retired cli-reference urls (#2179)#2197
Merged
Conversation
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>
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
Adds Astro static
redirectsmap toweb/sites/guides/astro.config.mjsso 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 staticredirectsmap does not support[...spread]sources without a backing page that suppliesgetStaticPaths—astro buildfails withGetStaticPathsRequiredwhen a spread-source redirect has no source file. The wildcard was removed; only the two documented Phase 0 URLs (index.mdxandinfo.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/_redirectsfile 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 redirectsls dist/v4-0-0-snapshot/cli-reference/— confirmsindex.htmlandinfo/index.htmlexist with meta-refresh + canonical to/command-line-tools/curl -sI http://localhost:4321/v4-0-0-snapshot/cli-referenceonastro dev→HTTP/1.1 308 Permanent Redirect,location: /v4-0-0-snapshot/command-line-tools/curl -sI http://localhost:4321/v4-0-0-snapshot/cli-reference/infoonastro dev→HTTP/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)🤖 Generated with Claude Code