docs: fix all redirect destinations to include /apm base path#1284
Merged
Conversation
Astro applies the configured `base` to redirect SOURCE keys automatically but emits redirect DESTINATIONS as literal strings into the meta-refresh tag. With `base: '/apm/'`, every redirect was landing on https://microsoft.github.io/<dest> (404) instead of https://microsoft.github.io/apm/<dest>. Prefix every destination with /apm/ so legacy /guides/*, /introduction/*, /getting-started/*, /enterprise/teams, /enterprise/governance, and /reference/cli-commands inbound links land on the rewritten persona-ramp pages. Source keys remain base-relative (Astro adds the /apm prefix at build time); a comment in the config records the asymmetry so future edits do not regress. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes broken legacy documentation redirects by ensuring redirect destinations include the /apm/ base path so generated meta-refresh and canonical URLs point to valid GitHub Pages routes.
Changes:
- Added documentation in Astro config explaining redirect source/destination asymmetry w.r.t.
base. - Updated all redirect destination paths to be rooted at
/apm/...while keeping sources base-relative.
Show a summary per file
| File | Description |
|---|---|
| docs/astro.config.mjs | Prefixes redirect destinations with /apm/ and documents why this is required for correct production redirects. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 4
Comment on lines
+18
to
+30
| // Astro applies the `base` prefix automatically to redirect SOURCE | ||
| // keys, but NOT to redirect DESTINATIONS -- destinations are emitted | ||
| // as literal strings into the redirect HTML's meta refresh / canonical | ||
| // link. Every destination below MUST therefore start with `/apm/` to | ||
| // land on the actual deployed URL on https://microsoft.github.io/apm/. | ||
| // Source keys MUST NOT include `/apm` -- the base is added at build | ||
| // time and the source would otherwise resolve under `/apm/apm/`. | ||
| redirects: { | ||
| // Legacy enterprise slugs | ||
| '/enterprise/teams': '/enterprise/making-the-case', | ||
| '/enterprise/governance': '/enterprise/governance-guide', | ||
| '/enterprise/teams': '/apm/enterprise/making-the-case', | ||
| '/enterprise/governance': '/apm/enterprise/governance-guide', | ||
| // Legacy intro section -> concepts | ||
| '/introduction/what-is-apm': '/concepts/what-is-apm', | ||
| '/introduction/why-apm': '/concepts/the-three-promises', | ||
| '/introduction/how-it-works': '/concepts/lifecycle', | ||
| '/introduction/key-concepts': '/concepts/glossary', | ||
| '/introduction/anatomy-of-an-apm-package': '/concepts/package-anatomy', | ||
| '/introduction/what-is-apm': '/apm/concepts/what-is-apm', |
| '/getting-started/installation': '/quickstart', | ||
| '/getting-started/authentication': '/consumer/authentication', | ||
| '/getting-started/migration': '/troubleshooting/migration', | ||
| '/getting-started/quick-start': '/apm/quickstart', |
| '/guides/org-packages': '/consumer/private-and-org-packages', | ||
| '/guides/ci-policy-setup': '/enterprise/enforce-in-ci', | ||
| '/guides/drift-detection': '/enterprise/drift-detection', | ||
| '/guides/dependencies': '/apm/consumer/manage-dependencies', |
| '/guides/drift-detection': '/apm/enterprise/drift-detection', | ||
| // Legacy reference monolith -> per-command | ||
| '/reference/cli-commands': '/reference/cli/install', | ||
| '/reference/cli-commands': '/apm/reference/cli/install', |
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.
Problem
Every legacy doc URL is currently broken in production. Clicking any inbound link to a removed page (e.g.
/apm/guides/marketplace-authoring/,/apm/introduction/why-apm/,/apm/reference/cli-commands) fires the redirect, but the meta-refresh sends the browser tohttps://microsoft.github.io/<dest>(404) instead ofhttps://microsoft.github.io/apm/<dest>.User report: clicking "Marketplace authoring" from /apm/producer/publish-to-a-marketplace/ went to a 404.
Root cause
Astro applies
base: '/apm/'to redirect SOURCE keys at build time but emits the redirect DESTINATION as a literal string into the meta-refresh tag and canonical link. Verified in the generateddist/guides/marketplace-authoring/index.html-- the meta refresh URL was/producer/publish-to-a-marketplace(no/apm/prefix).Fix
Prefix every redirect destination in
docs/astro.config.mjswith/apm. Source keys stay base-relative (Astro adds/apmat build time -- prefixing the source would resolve to/apm/apm/...).Verified post-build:
<meta http-equiv="refresh" content="0;url=/apm/producer/publish-to-a-marketplace">and canonicalhttps://microsoft.github.io/apm/producer/publish-to-a-marketplace.A comment in the config records the asymmetry so future edits do not regress.
Validation
npm run buildclean (100 pages, all internal links valid).guides/marketplace-authoring/andintroduction/why-apm/inspected and contains the/apm/prefix.Fixes the regression introduced by #1252.