Differentiate languages in your URLs
If you're building a multilingual website, consider how to differentiate the languages, locales, and regional variants of your content in your URLs.You can have several regional variants of a single language (British English, American English, Canadian English), multiple different languages (English, Spanish, French), or a combination of both.
Identify the language in the URL
To differentiate the language of your content in the URLs, you can choose from three common approaches:- Language as a top-level domain –
example.com
,example.de
,example.cz
- Language as a subdomain –
en.example.com
,de.example.com
,cz.example.com
- Language as a subdirectory –
example.com/en-us
,example.com/de-de
,example.com/cs-cz
/en-us/
in your URLs. With this approach, you can use language codenames to identify the language and its locale. The main benefit is that you don’t need to worry about domains and their renewal.
Decide on URL localization
You also need to decide whether your URLs should be localized or not. Do you need to use localized URL slugs?If you do, combine the language prefixes with the localized names of your content items. For example, a URL slug of the About us content item in English is
about-us
. Translated to Spanish, the URL slug changes to, for example, acerda-de-nosotros
. The URL for the About us content item in Spanish becomes https://example.com/es-es/acerda-de-nosotros
.Sign in with your Kontent.ai credentials or sign up for free to unlock the full lesson, track your progress, and access exclusive expert insights and tips!