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.
[ 01 ]
In short
In short
- 01
Give each language its own URL — usually a prefix such as
/az/,/ru/,/en/on one domain. - 02
Link equivalent pages with
hreflangannotations, including a self-reference and anx-default. - 03
Declare alternates only where a real translation exists.
- 04
List language versions and their alternates in the XML sitemap.
- 05
Never redirect search engine crawlers based on language; let them see every version.
[ 02 ]
Guide
URL options
| Option | Example | Notes |
|---|---|---|
| Subdirectories | example.az/en/services | One domain, shared authority, simple to manage — the common choice |
| Subdomains | en.example.az/services | Separates versions; authority may be split |
| Separate domains | example.az, example.com | Strong country signal; most maintenance |
| URL parameters | example.az/services?lang=en | Not 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 pagehreflang="ru"→ the Russian pagehreflang="en"→ the English pagehreflang="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.
hreflangpointing 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.