Bilingual routing that crawlers actually understand

How /en/ and /zh/ prefixes, canonical URLs and hreflang tags fit together on a static site.

#i18n#seo#cloudflare

Three rules keep a bilingual site from competing with itself in search results.

1. One URL per language, never a query string

/en/blog/post/ and /zh/blog/post/ are two crawlable documents. /blog/post/?lang=zh is one document with a parameter — Google will usually pick one version and ignore the other.

2. Canonical points at itself

Each language version declares itself as canonical. Pointing the Chinese page at the English one tells Google to drop the Chinese page entirely — the exact opposite of what bilingual SEO needs.

3. hreflang is reciprocal

<link rel="alternate" hreflang="en" href="https://example.com/en/blog/post/" />
<link rel="alternate" hreflang="zh" href="https://example.com/zh/blog/post/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/blog/post/" />

Every page in the cluster lists every other page, including itself. Miss one direction and search engines may ignore the whole set.

Practical rule: if the Chinese translation does not exist yet, do not emit an alternate link for it. A broken hreflang is worse than no hreflang.

Deploying

Cloudflare Pages builds npm run build and serves dist/. Custom domain, automatic TLS, and global edge caching come with it — no server to maintain.

This post is also available in 中文

← Back to all posts