fix: normalize developer tool URLs to prevent ~950 SEO 404s#17853
Conversation
BuidlGuidl data contains bare domains (e.g. "bonadocs.com"), partial
URLs ("x.com/rv_inc"), and bare handles ("@thirdweb") in website and
twitter fields. These fail the isExternal() check and get rendered as
relative internal paths, producing ~950 broken 404 URLs across locales.
Normalize URLs at the fetch boundary: prepend https:// to bare domains,
and convert twitter handles/partial URLs to full https://x.com/ URLs.
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
myelinated-wackerow
left a comment
There was a problem hiding this comment.
Clean fix, good call normalizing at the fetch boundary.
Edge cases to consider:
-
Non-http protocols in
normalizeUrl()-- A value likeftp://somethingwould becomehttps://ftp://something. Could guard with/^\w+:\/\//instead of/^https?:\/\//to pass through any protocol-prefixed string. -
normalizeTwitter()fallback -- Any unrecognized string becomeshttps://x.com/<value>. If a Twitter field ever held a non-Twitter URL (e.g. a Mastodon link), it'd produce a broken x.com URL. Low risk given the data source, but worth noting. -
Optional: export to
src/lib/utils/url.ts--normalizeUrl()is generic enough to be useful for other fetchers that ingest messy third-party data (apps/dapps). Keeping it private is fine for now, but centralizing could prevent duplication later.
Reviewed by Claude Opus 4.6

Summary
websiteandtwitterfields from BuidlGuidl developer tools data at the fetch boundarybonadocs.com), partial URLs (x.com/rv_inc,twitter.com/alchemy), and bare handles (@thirdweb,dexkit) that failisExternal()and get rendered as relative internal paths — producing ~950 broken 404 URLs across 25 localesnormalizeUrl()(prependshttps://to bare domains) andnormalizeTwitter()(converts handles and partial URLs to fullhttps://x.com/URLs) infetchBuidlGuidl.tsContext
This is the highest-leverage fix from the March 2026 SEO audit — eliminates 93% of all internal 4xx errors (950 of 1,024). See
docs/seo-audit-action-items.mdfor full audit breakdown.Examples of broken URLs this fixes:
bonadocs.comethereum.org/content/developers/tools/education/bonadocs.comhttps://bonadocs.com@thirdwebethereum.org/ur/developers/tools/sdks/@thirdwebhttps://x.com/thirdwebx.com/rv_incethereum.org/pl/developers/tools/security/x.com/rv_inchttps://x.com/rv_incTest plan
npx tsc --noEmitpasses)