From a5db40f8950e2f508522c793fb2bce1899dd7fc3 Mon Sep 17 00:00:00 2001 From: ShashiSubramanya Date: Fri, 21 Aug 2026 21:37:02 +0530 Subject: [PATCH] link fixes --- src/components/SecondaryHeader/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/SecondaryHeader/index.tsx b/src/components/SecondaryHeader/index.tsx index e649b3946..cc2419811 100644 --- a/src/components/SecondaryHeader/index.tsx +++ b/src/components/SecondaryHeader/index.tsx @@ -155,9 +155,15 @@ const SecondaryHeader = (props: { // Stay on this wrapper page and retarget the nested iframe instead of // navigating to the unversioned CATEGORY_LANDING page, which would drop // the user out of the pinned older version. + // Query-only (no pathname) so the browser resolves it relative to the + // current URL via pushState's native relative-URL resolution. Building + // the target from location.pathname here duplicated the site's /docs + // pathPrefix in production (404s), while working fine in local dev, + // which has no prefix — root cause in Gatsby's routing not fully + // isolated, but this sidesteps the pathname reconstruction entirely. const params = new URLSearchParams(location.search); params.set('pageid', landing.replace(/^\//, '')); - navigate(`${location.pathname}?${params.toString()}`); + navigate(`?${params.toString()}`); return; } navigate(landing);