Skip to content

docs: fix all redirect destinations to include /apm base path#1284

Merged
danielmeppiel merged 1 commit into
mainfrom
fix/docs-redirect-base-path
May 11, 2026
Merged

docs: fix all redirect destinations to include /apm base path#1284
danielmeppiel merged 1 commit into
mainfrom
fix/docs-redirect-base-path

Conversation

@danielmeppiel
Copy link
Copy Markdown
Collaborator

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 to https://microsoft.github.io/<dest> (404) instead of https://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 generated dist/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.mjs with /apm. Source keys stay base-relative (Astro adds /apm at 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 canonical https://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 build clean (100 pages, all internal links valid).
  • Redirect HTML for guides/marketplace-authoring/ and introduction/why-apm/ inspected and contains the /apm/ prefix.

Fixes the regression introduced by #1252.

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>
Copilot AI review requested due to automatic review settings May 11, 2026 21:11
@danielmeppiel danielmeppiel merged commit f571750 into main May 11, 2026
18 checks passed
@danielmeppiel danielmeppiel deleted the fix/docs-redirect-base-path branch May 11, 2026 21:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread docs/astro.config.mjs
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',
Comment thread docs/astro.config.mjs
'/getting-started/installation': '/quickstart',
'/getting-started/authentication': '/consumer/authentication',
'/getting-started/migration': '/troubleshooting/migration',
'/getting-started/quick-start': '/apm/quickstart',
Comment thread docs/astro.config.mjs
'/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',
Comment thread docs/astro.config.mjs
'/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',
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.

2 participants