Best practice for URLs of multi-language websites

前端 未结 3 2006
花落未央
花落未央 2021-01-17 11:58

What is considered the best strategy for URLs of translated websites? Something I see happen frequently is:

http://example.com/english-slug.html
http://examp         


        
3条回答
  •  花落未央
    2021-01-17 12:28

    The best solution, if you can afford it, is to send the document with the right name, that means, using the right word on each language.

    Of course each document should be sent with the respective language setting on the headers.

    For storing them, you can use folders and let the web server choose the right document according to the language preference; or you can use server side technology, like PHP, perl, etc to send the document and adjust the URL.

    In any case, you have to have a default language to be sent when you don't have the requested language.

    If you can't or don't want to send document with the right name, using subdomains is the best next option. This option, is not as common as adding the language after the domain, and that means, that people may not be used to it, although, it has some advantages, for instance;

    • Each language behaves like a whole new URL/site (almost).
    • People feel like visiting a dedicated site, not a subsection where the second language is relegated and may fail at any moment (some content may not be translated).
    • Some people are not familiar with their two letter representation of language, but everybody knows how his language is called and spelled.
    • It generates cleaner URL's.
    • It is believed that having subdomains increases appearance on SERPs (I don't have knowledge of this and it may have changed).
    • It's easier to have different layouts if you want to.
    • It's easier to set different servers according to language.

    Of course subdomains have some disadvantages, like:

    • A bit more work to set properly from the server perspective.
    • Less collaboration from the part towards high ranking.
    • Some people may not expect it but expect a subfolder.

    Next would be the subfolder option, as you show on the question. This is the recommended way if your main perspective is SEO since all the relevance of the domain stays on that same domain and each language helps to a common "pot" of ranking.

    My perspective when choosing a solution, is never SEO, under any circumstance. Whatever ranking I get is due to the content itself and the best use I can give to technology. But I understand that my point ov view is not the most common.

    One thing to consider also, is that you should provide some kind of explanation or help the user so he can take actions to change to the preferred language. It may be using icons, a tooltip, or any other method that works for your design and verbosity.

    One thing to avoid, and you didn't ask for it, but is related; is using language autodetection. Lots of times, the user is in a different country or using a version of a browser that has a different language from what he can understand and the autodetction just makes a big mess. Offer the default version and a clear way to change it.

提交回复
热议问题