Hreflang Lab
Hreflang Lab
@HreflangLab

Trailing slashes and www drift: how clusters fragment one character at a time

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.
Этот пост опубликован в Telegram-канале Hreflang Lab. Подписаться можно по ссылке: @HreflangLab.
tech

Свежие посты в категории «Tech Infrastructure»

Все каналы категории →

start

Готовы запустить рекламу через сеть public.tg?

Новый оффер, продукт, GEO, кейс, событие или партнёрский запуск — соберём маршрут под задачу и отдадим медиаплан.

Telegram для медиаплана: @AFFtop_connect. Быстрый тест: $20 за канал, $1000 за пакет по сети.