Skip to content

fix: redirect legacy docs home URLs to docs root - #3575

Open
EduardF1 wants to merge 2 commits into
microsoft:v2from
EduardF1:fix/docs-home-redirect
Open

EduardF1 wants to merge 2 commits into
microsoft:v2from
EduardF1:fix/docs-home-redirect

Conversation

@EduardF1

@EduardF1 EduardF1 commented May 30, 2026 •

Copy link
Copy Markdown

Summary

Fixes #3247

The legacy docs-home URLs loop. On the live site:

$ curl -s https://www.typescriptlang.org/docs/home
<script>window.location.href="/docs/home"</script>
$ curl -s https://www.typescriptlang.org/docs/home.html
<script>window.location.href="/docs/home"</script>

/docs/home.html and /docs/home both end up on a client-side stub that redirects to /docs/home again. The chain in veryOldRedirects (/docs/home.html to /docs/home to /docs) collapses into a single file on the static host, and the stub that wins is the self-referencing one.

Changes

  • /docs/home.html now redirects straight to /docs/
  • /docs/home now redirects straight to /docs/

One hop each, no intermediate route. /docs/ (with the trailing slash) is the target because the host answers /docs with a 301 to /docs/, and it matches the other docs-root targets in handbookRedirects (/docs/tutorial.html, /docs/bootstrap, /docs/handbook/release-notes).

Testing

  • pnpm exec prettier --check packages/typescriptlang-org/src/redirects/setupRedirects.ts
  • git diff --check
  • Verified the current loop on the live site with the curl calls above; the redirect table now sends both legacy URLs to /docs/.

@EduardF1
EduardF1 force-pushed the fix/docs-home-redirect branch from a21fb64 to 75bb2e4 Compare June 4, 2026 00:07
@EduardF1

EduardF1 commented Jun 4, 2026

Copy link
Copy Markdown
Author

Friendly ping — CI checks passed. Let me know if there's anything you need changed here!

@EduardF1

Copy link
Copy Markdown
Author

Friendly follow-up with the validation details to make review quick:

  • This collapses a chained redirect. Today /docs/home.html → /docs/home → /docs is two hops; the PR makes both legacy URLs redirect in a single hop to the docs root.
  • The target /docs/ matches the dominant convention for docs-root redirect targets already in setupRedirects.ts — e.g. /docs/tutorial.html, /docs/bootstrap, /docs/handbook/release-notes, and /docs/handbook/release-notes/overview all redirect to /docs/.

CLA check is green and the PR is mergeable with no conflicts against v2. Let me know if you'd prefer the trailing-slash-less /docs form for consistency with the older veryOldRedirects entries instead — easy one-line change either way.

@EduardF1
EduardF1 force-pushed the fix/docs-home-redirect branch from 75bb2e4 to 7fae52f Compare June 30, 2026 13:03
@EduardF1

Copy link
Copy Markdown
Author

Friendly ping — this is mergeable with the CLA green; it just needs a maintainer review. Happy to adjust (e.g. the trailing-slash /docs/ vs /docs choice) if you'd prefer.

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.

Bad redirection from /docs/home

1 participant