# A site in two languages: one address per language

> Give each language its own address. See how a static site serves two languages, what to tell search engines, and why a redirect by language fails.

Source: https://customhosted.com/guides/a-site-in-two-languages/

№ 12 Field manual

Operations · Updated 25 November 2026 · 6 min read

Contents

1. One address per language
2. Do not guess the language
3. Tell search engines
4. What each page declares
5. This site is one language
6. Keeping languages in step
7. Asking for it

The short version

1. 01 — Give each language its own folder and its own address. A static site then needs no edge rule and no guess about the visitor.
2. 02 — Do not redirect by browser language. Add a visible link to the same page in the other language.
3. 03 — Each page names itself as canonical, lists its other-language twin, and sets its own language tag. Your own words and fonts stay your job.
4. 04 — Two languages drift apart. One brief and one pull request carry both, and a build check catches a page that exists in one language only.

## One address per language

The simplest way to serve two languages is one folder per language. English lives at `/about`. French lives at `/fr/about`. Each page is its own file with its own address.

A static site needs no special rule for this. The edge maps a clean link to the folder’s index file, and a language folder is only a folder. The table below shows what the edge serves for three requests.

| Request | File served | Why |
| --- | --- | --- |
| /fr/ | /fr/index.html | The build wrote fr/index.html. The edge adds index.html to a path that ends in a slash. |
| /fr/about | /fr/about/index.html | The last part has no dot, so the edge treats it as a folder. A language folder needs no edge rule. |
| /about?lang=fr | /about/index.html | The edge reads only the path. It serves the English file and ignores the query string. A query string cannot pick a language. |

The build runs these rows through the real edge function, so the table cannot drift from the code that serves it. See [static sites](https://customhosted.com/host/static-sites) for the whole table.

The last row is the trap. Many sites pick a language with `?lang=fr`. The edge ignores the query string, so every visitor gets the English file. Use a folder.

## Do not guess the language

Some sites send a visitor to a language by browser setting or by country. That is a decision made on each request. The check that matches a URL to a rule runs at the edge. It doesn't run your code. Anything that computes an answer per request needs an instance behind it.

A guess also fails people. A traveller has a browser set to the wrong language. A search crawler sends no language setting at all, so a redirect can hide a whole language from it.

Do this instead. Put a visible link on every page that goes to the same page in the other language. Label it in that language: “Français”, not “French”. The visitor decides.

Routing by country is a different job. It happens in DNS, and it is a custom quote. See [domains](https://customhosted.com/domains).

## Tell search engines

A search engine sees two pages with the same meaning. Tell it how they relate. Three steps do it:

1. **Each page names itself as canonical.** Every page states its own permanent URL in its own markup, so a crawler never has to pick between two copies of the same page. The French page points at the French address, not the English one.
2. **Each page lists its twin.** Add a language alternate link (developers call it _hreflang_) for every language, including the page’s own. The twin lists the first page back. Add one default entry for readers whose language you do not serve.
3. **Both languages go in the sitemap.** The build lists every route, so a new language folder joins it with no extra work.

No ranking, position, or traffic promise. A crawlable, fast, correctly marked-up site is what we can prove. Where it ranks depends on your content, your market, and a search engine's own algorithm — none of which we run. See [being found](https://customhosted.com/being-found) for the half we own.

## What each page declares

A page also tells browsers and assistive tools which language it uses. Four things belong on a multilingual site:

| Declare | How | Why |
| --- | --- | --- |
| The language of the page | A language tag on the page root. `lang="fr"` | A screen reader picks the right voice. A browser offers the right spelling check. WCAG 3.1.1. |
| A passage in another language | A language tag on that passage only. `lang="fr"` | A screen reader switches voice for a French quote inside an English page. WCAG 3.1.2. |
| The direction of the text | A direction on the page root, for Arabic, Hebrew and other right-to-left scripts. `dir="rtl"` | Without it, punctuation and mixed numbers land on the wrong side of a line. |
| A font that covers the script | Check that each font has the letters. Add a font for the script if it has not. | A missing letter falls back to a system font, and the page looks mixed. |

See [accessibility](https://customhosted.com/accessibility) for our own self-assessment.

## This site is one language

This site is in English only. Every page carries `lang="en"` on its root, and `check:seo` fails the build if one loses it. With one language there is no twin to list, so the site has no language alternate links. That is correct, not a gap.

The font is the other receipt. The display font of this site ships 3 scripts: Latin, Latin Extended and Vietnamese. A headline in Cyrillic or Arabic would fall back to a system font. A site in those languages needs a font that covers them. Check this before the design is final.

## Keeping languages in step

The hard part comes in the third month. Someone changes the English price and forgets the French page. Now the two languages disagree.

Two habits prevent most of it. First, one change covers both languages, in one pull request. Second, a build check fails when a route exists in one language and not the other. This site uses the same idea in `check:twins`: every page must have its Markdown copy.

[CodeHerder](https://codeherder.com) carries the change. This is how one change ships:

1. **You send both versions.** Write the change in one language and send the translated text with it. Say which pages change in each language.
2. **Briefed as a change.** Written up the same way any other change request is. The iteration add-on is what covers it.
3. **An agent opens the pull request.** The change lands as a real pull request against the repository, with the test suite run against it.
4. **A human reviews and merges.** Someone reads the diff before it goes anywhere near production — nothing here is auto-applied blind.
5. **It ships through the same pipeline.** The same pipeline that deploys everything else on your stack ships this too — no separate process to babysit.
6. **You're told it's done.** A note confirming what changed and that it merged, in the same shape as every other note on this site.

A person who reads the language approves the change. We do not translate your words, and we do not judge a translation.

## Asking for it

A second language is a briefed change. CodeHerder is $25/mo on any plan. A two-language static site fits the Static Starter plan at $5/mo. [Quote this shape](https://customhosted.com/contact?plan=ST-STARTER&amp;addons=AD-CH&amp;stage=already-live&amp;type=content). The form opens with this plan and add-on filled in.

A second language adds files, not much traffic. The plan’s fair-use allowance is ~100 GB transfer/mo. Read [content](https://customhosted.com/content) for how a copy change ships.

An app that picks a language per visitor needs a dedicated instance, from the Dedicated S plan. [Quote that shape](https://customhosted.com/contact?plan=DD-S&amp;addons=AD-CH&amp;stage=already-live&amp;type=content). [CustomLabs](https://customlabs.io) can build the language switcher and the translated screens.

Next in the manual

## Keep reading

- [Search on a static site: a search box with no server A static site can have a search box. See the four ways to build one, what each one costs, and when a site outgrows the simplest.](https://customhosted.com/guides/search-on-a-static-site)
- [What “managed” actually means — and the hours it gives back See the work managed hosting takes off your week: patching, backups, monitoring and a human who answers. Each task comes with the hours it saves.](https://customhosted.com/guides/what-managed-hosting-includes)
- [Keeping a site private: unlisted, a password, or a sign-in A hidden link is not a locked door. See the three real ways to close a site, which one fits who needs in, and what each one cannot do.](https://customhosted.com/guides/keeping-a-site-private)

## Ready to start?

Tell us what you're running — one fixed monthly rate, within a business day.

[Get a quote →](https://customhosted.com/contact)
