About UsBlogContact
Discuss your project

Guide · Building & launching

URL structure and hreflang for multilingual websites

A multilingual website must tell search engines three things: that each language version is a separate page, which pages are translations of each other, and which version to show to whom. Getting this right means that a Russian speaker in Baku sees the Russian page in search, an English speaker sees the English one, and the versions do not compete with each other. This guide explains the structure and the most common mistakes.

Updated · 4 min read · DealPro

[ 01 ]

In short

In short

  1. 01

    Give each language its own URL — usually a prefix such as /az/, /ru/, /en/ on one domain.

  2. 02

    Link equivalent pages with hreflang annotations, including a self-reference and an x-default.

  3. 03

    Declare alternates only where a real translation exists.

  4. 04

    List language versions and their alternates in the XML sitemap.

  5. 05

    Never redirect search engine crawlers based on language; let them see every version.

[ 02 ]

Guide

URL options

OptionExampleNotes
Subdirectoriesexample.az/en/servicesOne domain, shared authority, simple to manage — the common choice
Subdomainsen.example.az/servicesSeparates versions; authority may be split
Separate domainsexample.az, example.comStrong country signal; most maintenance
URL parametersexample.az/services?lang=enNot recommended; harder for search engines

See subdirectories vs subdomains for languages. A common pattern is to keep the main language without a prefix and others with prefixes, or to prefix all languages consistently. Both work if applied consistently.

hreflang

hreflang annotations tell search engines which pages are equivalents in different languages. Each version lists all versions, including itself:

  • hreflang="az" → the Azerbaijani page
  • hreflang="ru" → the Russian page
  • hreflang="en" → the English page
  • hreflang="x-default" → the version for everyone else, usually the main language or a language selector

Annotations must be reciprocal: if the Azerbaijani page points to the English one, the English page must point back. One-sided annotations are ignored. They can be placed in the page head, in HTTP headers or in the XML sitemap. See hreflang.

Only real translations

Declare an alternate only when the translated page exists and contains translated content. A hreflang="en" pointing to a page that is still in Azerbaijani is a mismatch that can cause search engines to ignore the annotations or pick versions themselves. If only some pages are translated, annotate only those.

Language and region codes

Use language codes (ISO 639-1), optionally with region codes (ISO 3166-1): ru for Russian in general, ru-AZ for Russian for Azerbaijan. Most businesses targeting Azerbaijan need only language codes. Region-specific codes make sense when the same language is served differently to different countries.

Sitemaps

The XML sitemap should list every language version, and can include xhtml:link alternates for each URL. This helps search engines discover translations and confirm the relationships. See XML sitemaps and robots.txt.

Language switcher

  • Switch to the same page in the other language, not to the home page.
  • Show language names in their own language ("Azərbaycan", "Русский", "English").
  • Do not use flags alone — languages are not countries.
  • If a page has no translation, lead to the closest translated page and say so.

Automatic redirects

Redirecting visitors by browser language can help users, but it must never apply to search engine crawlers, which usually crawl without language preferences and would see only one version. If you use automatic redirection, do it once, allow users to switch back, and exclude crawlers.

Content per language

Titles, meta descriptions, headings, image alt text, structured data and URLs slugs (optional) should all be in the page's language. Mixed-language pages confuse both users and search engines.

Common mistakes

  • Translating only the interface, leaving main content in another language.
  • hreflang pointing to redirected or non-canonical URLs.
  • Canonical tags on translated pages pointing to the main language version — this tells search engines to ignore the translations.
  • Missing self-referencing hreflang.
  • Language switcher that resets to the home page.

[ 03 ]

FAQ

Frequently asked questions

Should URL slugs be translated?

It is optional. Translated slugs are friendlier to readers; identical Latin slugs across languages are simpler to maintain. Either works if consistent.

Do we need x-default?

It is recommended. It tells search engines which version to show users whose language does not match any of your versions.

Can Google detect the page language without hreflang?

Google detects the language of content, but hreflang clarifies which pages are equivalents, which prevents versions from competing and helps the right one appear.

Related reading

[ 04 ]

Next step

Have a project in mind?

Describe the task in a few lines. We reply with questions and the next step — no commitment and no templated proposal.