Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best place to display the language in your URL?

Tags:

I have a multi-language website that makes use of pretty URLs, so called search-engine-friendly URLs.

Now there are a few places to define the language in the URL:

    • www.example.com/en/articles/random
    • www.example.com/nl/articles/random
    • en.example.com/articles/random
    • nl.example.com/articles/random
    • www.example.com/articles/random?lang=en
    • www.example.com/articles/random?lang=nl

Is there any preferred way of showing this, or is there another better way that I did not include?

like image 920
Saif Bechan Avatar asked May 28 '10 18:05

Saif Bechan


People also ask

How do I change the language on a URL?

Using language prefixes for URLs To enable language prefixes, go to Settings -> URLs and SEO, and enable the Use language prefix for URLs setting. Note: You cannot use language prefixes if the Force domain culture setting is enabled.

How do I know what language a website is using?

Look at the Source Code The source code of a website is easily accessible from your browser. In Chrome, look for Developer Tools, in Firefox look for Web Developer in your menu. The source code's file extensions and URLs can tell you what type of platform the website is built on.

Should URLs be in English?

This includes non-Latin characters in your URLs. John Mueller said “as long as URLs are valid and unique, that's fine.” He added, “So to sum it up, yes, non-English words and URLs are fine, and we recommend using them for non-English websites.”


1 Answers

I'll tell you what is NOT best practice - using parameters (3rd one). Making users type a complicated URL is asking for trouble.

Your pages can internally use GET parameters to find the lang, but use a URL rewrite module available in your web server to make it simple such as the 1st one - www.mydomain.com/en/articles/random

Even the second one is okay, except most users type domain name and hit Ctrl + Enter.

https://addons.mozilla.org/en-US/firefox/

http://msdn.microsoft.com/en-us/default.aspx

http://www.apple.com/in/

Mozilla, Microsoft and Apple are in three different corners of the software development world, in terms of.. well.. everything. Sometimes I tend to think that those three big guys do stuff just to disagree with each other. But if they are following a common practice, it must make sense...

like image 117
Senthil Avatar answered Nov 02 '22 03:11

Senthil