.NET life

HUGON Jérôme
Microsoft Certified Technology Specialist Microsoft Certified Application Developer Microsoft Certified Professional

URLs, globalization and localization on multilingual websites

Category Miscellaneous  | Publication Date : 11/27/2010

When designing a multilingual website, the representation of different languages in URLs is an important aspect of design. Indeed, how to separate the languages are often implemented in the heart of the project and any changes would result in heavy maintenance. The worst thing is to not consider this point at all. Companies not taking the time to prepare for internationalization will be later forced to incur significant costs when the whole site must support multiple languages.
This article describes a non-exhaustive list of techniques for implementing a multilingual site with the advantages and disadvantages of each.

Country-specific TLD

A different domain for each language.

Examples:

  • mysite.fr
  • mysite.de
  • mysite.es
Reviews of this technique:
  • The cost to register domain names are recurrent and proportional to the number of languages.
  • A country has not always one language (eg Switzerland or Belgium).
  • The obligation to access to DNS management.

Language-specific subdomains

It uses a language code as subdomains on the domain name of the main site.

Examples:

  • fr.mysite.com
  • de.mysite.com
  • es.mysite.com
Reviews of this technique:
  • A single domain name to own.
  • A language is not always used by one country and yet the contents may need to be different in these countries.
  • The obligation to access to DNS management.
  • The organization is simple and clean.

Directory structure according to the languages and countries

The directory structure reflects the language and/or the country. This can be achieved with physical directories or with URL Rewritting.

Examples:

  • www.mysite.com/en/
  • www.mysite.com/ch-fr/
  • www.mysite.com/es/
Reviews of this technique:
  • Maintenance can be cumbersome in case of separated physical directories.
  • URLs no longer reflect only the content of the page but also other properties such as country and language.
  • Ease of implementation especially with a rule rewritting URL.

Using QueryString to determine the language and the country

You use the QueryString to pass to the page the desired language. It's certainly what a rewritting rule will do with the previous technique.

Examples:

  • www.mysite.com/?lang=fr
  • www.mysite.com/?lang=ch-fr
  • www.mysite.com/?lang=es
Reviews of this technique:
  • Bad for SEO because pages are considered as static with variables contents.
  • URLs aren't cleaner.
  • The semantics of URLs is abandoned.

Conclusion

The combination of several of these techniques, in my view, is essential to obtain the best result in terms of ease of maintenance, possibility of extension to new languages and especially to search engines optimization (SEO).

By combining a country-specific TLDs and subdomains specific language, you can have a content by language and country.

Examples:

  • fr.mysite.ch
  • de.mysite.ch
  • it.mysite.ch
  • www.mysite.fr
  • www.mysite.de
  • www.mysite.it
The above examples present how to separate the different languages of the same content within a country (.ch = Switzerland) but also to separate identical content between different languages (eg fr.mysite.ch and www.mysite.fr).

For best results with human users of your site, you can also pre-select the language of the user based on the value of the variable Accept-Language sent with HTTP headers. On the other hand, you can also store user preference in a cookie so that at the next visit, visitor's preferences are restored.

This method of combining several techniques is certainly the most costly in terms of investment and time to set up but it remains the most complete and most durable.


Related articles

URL Rewriting for SEO: Enforce canonical pages

IIS7

Category IIS7  | Publication Date : 1/24/2010

URL Rewriting for SEO: Enforce canonical host names

IIS7

Category IIS7  | Publication Date : 1/24/2010