The site started Chinese-first. That made sense when I was writing it. Then I looked at where the traffic actually came from and realised almost everyone arriving was English-speaking.

So I made English the default. The translation work was the easy part. The redirect was the part that took thought.

What "default" means in a static i18n setup

With a prefixed-locale setup, both languages live under their own path: /en/ and /zh/. There is no page at the bare root unless you make one.

My first attempt just pointed the root at the English page with a normal redirect. That worked, but it left search engines with two versions of the homepage — the root and /en/ — competing for the same query.

The fix had two pieces. First, a server-side 301 from / to /en/, so there is one canonical URL. Second, an x-default hreflang tag pointing to /en/, telling search engines that English is the fallback for anyone whose language does not match a specific version.

The mistake I made with hreflang

I initially set x-default to the Chinese page, because that was the original. That quietly told search engines the opposite of what I wanted. It is a one-line change, but the effect on which version gets shown is significant.

I also had to update the sitemap. The x-default entry there needed to match the one in the page head. Having them disagree is worse than having neither.

Why a 301 and not a client-side redirect

A JavaScript redirect runs after the page loads, which means crawlers may record the root as a real page. A 301 is unambiguous: the root is gone, this is the new address. On Cloudflare Pages a single line in the redirects file does it.

The result

After the change, shared links and search results consistently land people on the English version. Chinese readers can still switch with one click, and /zh/ is fully indexed.

The lesson: when you change the default language of a bilingual site, spend your time on the canonical and redirect layer. The words are secondary.