Trailing slashes and www drift: how clusters fragment one character at a time
Finding: a surprising share of "broken" hreflang clusters are broken by URL normalization mismatches — differences so small they survive code review.
hreflang matching is exact-string at the URL level. The crawler needs the URL referenced in an annotation to be the same URL it actually indexes. Four near-invisible discrepancies break that:
— Trailing slash: hreflang points to /de/page, the indexed/canonical URL is /de/page/
— Protocol: tags reference http:// while the site canonicalizes to https://
— Host: www. in the tag, non-www in the canonical (or vice versa)
— Case: an uppercase character in a path that the server treats as distinct
Any of these means the hreflang target and the real URL are different strings, so the annotation points at a URL that doesn't quite exist as indexed — and reciprocity silently fails.
The fix:
— Generate all hreflang hrefs from the same canonical-URL function the rest of the site uses, never hand-built
— Decide trailing-slash and www policy once, enforce it with redirects, and make hreflang consume the post-redirect form
— Confirm hreflang URLs match canonical URLs byte-for-byte
Methodology tip: export your hreflang hrefs and your canonical URLs and diff them programmatically. Visual inspection misses single-character drift reliably; a string comparison doesn't.
Limitation: this is purely mechanical, so there's no nuance to debate — but precisely because it's mechanical, it's easy to dismiss as too trivial to be the cause. It frequently is the cause.
Hreflang Lab
@HreflangLab
Trailing slashes and www drift: how clusters fragment one character at a time
Этот пост опубликован в Telegram-канале Hreflang Lab. Подписаться можно по ссылке: @HreflangLab.