← Issues index

43. DH migrated stories still served at their old URLs with 200 and a self-canonical; Google picks the old URL — High (DH), same code on PV

Added 18 Nov 2026. Found in the Search Console Page indexing exports (indexing/2026-11-18/dh-google-chose-canonical/, data to 13 Nov 2026; checks/index_coverage/summary_dh_2026-11-18.md).

What: old (pre-Quintype) story URLs such as /content/267116/jds-leader-hacked-death.html still return 200 with the full story and a canonical pointing to themselves, instead of a 301 to the current URL (/india/karnataka/bengaluru/jds-leader-hacked-death-2350290). The same story is live at two URLs that each declare themselves canonical, and Google often chooses the old one.

Evidence

Cause: tpml-dh app/server/data-loaders/story-page-data.js:105–115 (ee69e96a, 17 Nov 2026): when no story has the requested slug, fallbackForOldSlug() looks the story up by story-attributes.oldslug and renders it at the old path. The request reaches it through the /:collectionSlug-style section fallback (section-page-data.js:56). The story-redirect middleware in app/server/app.js:356–390 only compares the current slug (getStoryBySlug), so it never redirects old slugs. The canonical then comes from the requested path. PV has the same fallback (tpml 0b3f7227, app/server/data-loaders/story-page-data.js:107); PV's "Google chose different canonical" is only 1,240 (47% old .html story URLs), so the exposure there is small.

🛠️ Fix: in the old-slug fallback, 301 to /${newMigratedSlug} instead of rendering (e.g. return a redirect from the loader, or do the oldslug lookup in the app.js story-redirect middleware). Same for /amp/content/… and /amp/story/content/… → the current AMP or article URL. Do PV at the same time. Keep the change narrow: only when the oldslug lookup finds a story.

Verify: curl -sI https://www.deccanherald.com/content/267116/jds-leader-hacked-death.html → 301 to /india/karnataka/bengaluru/jds-leader-hacked-death-2350290; after 4–8 weeks, "Duplicate, Google chose different canonical than user" falls and Search Console clicks move from /content/ URLs to current URLs (gsc_query with contains /content/).

Related: #14 (crawl waste), #21 (same fallback path on PV serves /<slug> copies), #38 (old Drupal image URLs).