Built with Chinaski

URL Modes

A multilingual Chinaski site can present its languages in three different URL shapes. Which one is in effect is decided by the Language URL mode setting (Settings → Permalinks), and mostly it is decided for you: the mode follows the number of languages you configure. This page explains each mode and the rules around them.

The three modes

  • Path: the language code is the first path segment: https://example.com/en/about, https://example.com/es/sobre. Each language builds into its own directory in the output. This is the default for multilingual sites.
  • None: no language code anywhere in the URL. Content lives right under the domain root in a single output tree. This is the mode for monolingual sites; a single-language site always uses it.
  • Subdomain: the language becomes its own subdomain: a post that is https://en.example.com/blog/hello in English is https://es.example.com/blog/hola in Spanish. The pages’ canonical URLs, hreflang alternates, sitemap entries, and even the admin View links all use the per-language host automatically.

You don’t set it, mostly; it follows your language list

The mode is derived, not free-standing. When you change your active languages, the mode is recomputed for you:

  • More than one language → path (unless you’ve explicitly chosen subdomain, which is preserved).
  • Exactly one language → none.

A stale value can’t creep in: the setting is normalized whenever languages change, on permalink saves, and once more when the app loads. This guards against a stale “path” mode on a monolingual site, which would serve 404s. If you set subdomain for your multilingual site, it stays that way until you change it back; it is never silently flattened.

You don’t need to do anything after changing languages: the mode adjusts itself on save, and saving the Permalinks tab always triggers a rebuild so the output tree matches.

What changes on your server

When the mode is none, everything is served out of the root output directory. With path or subdomain mode, the deployed web-server root points at the default language’s directory instead (the default language code is folded into the web-server document root). A standard deploy syncs this automatically: deploy scripts update the nginx site config to the correct root and reload the service.

If you use subdomain mode with your own reverse proxy, your hosting must answer each <lang>.your-domain.com; the builder generates the right URLs, but your proxy needs the matching host rules.

Interactions with other settings

  • Home redirect: with multilingual content, the domain root can redirect to the blog or elsewhere; set it on the Permalinks tab. Rebuild required after changing.
  • hreflang alternates: per-language alternate links are generated in path and subdomain modes when a Site URL is configured; a monolingual (none) site has no alternates by definition.
  • Canonical URLs: in subdomain mode each language’s canonical sits on its own subdomain; otherwise all canonicals share the single domain you set as Site URL.
Read this site in