skip to Main Content

I’m ready to use the subdirectory format for my multilingual website.
My first question is:
For SEO, have I to translate the page name in the url or it is useless?
Example:

- Same filename
site.com/fr/login
site.com/en/login

OR

- Different filename
site.com/fr/connexion
site.com/en/login

Then, when user is on site.com: Should I redirect him to site.com/en and site.com/fr depending user’s IP? Or have I to set a default local, and have my url like site.com/page and site.com/fr/page

Finally, what is the best way to get the local from user’s current URL?
Parsing url to get /fr or /en, or add a GET parameter in url with lang=fr (hidden with htaccess)

Thanks πŸ™‚

4

Answers


  1. Think about humans at the first. Is the URL translation important for users in France? Some people may think what it’s fine to get translated words in the URL. Users from other locales may think otherwise. Search engines take into account user behavioral factors. SEO factors will higher if you solution is more convinient for users.

    It whould be nice if users get an expected language version. A site could help them if it suggests a language version by IP, HTTP headers, cookies and so on. Some people may prefer another language, some people may be on a trip. So it’s still important let them to choice a language version manually.

    Please read manuals and analyze competitors sites in case of doubt.

    Login or Signup to reply.
  2. i usally show in mostly website they give url like site.com/en and site.com/fr as you mention but it upon you how you want to show website to user. i prefer make default site.com/en and give user option to select his language.

    if you still confuse then refer below link it will usefull.

    See Refferal Link Here

    Login or Signup to reply.
  3. Should you translate paths?

    If possible, by all means – as this will help users of that language to feel like “first class citizens”. Login routes probably won’t have much impact on SEO, but translating URLs on content pages may well help them to be more discoverable.

    You can read Google’s recommendations on multi-regional and multilingual sites, which state that it’s “fine to translate words in the URL”.

    Should you redirect based on IP?

    This can help first time users, but there are a few things to bear in mind:

    • How accurate will this be? E.g. if I speak English but I visit France and then view your site – I will get French. If your target market is mobile-toting globe-trotters, then it may not be the best choice. Is looking at Accept-Language, for example, any better?

    • Will geolocating the IP address on every request introduce any performance problems for your servers? Or make too many calls to an external geocoding service? Make sure to carry out capacity planning, and reduce calls where you already know the locale (e.g. from a cookie, or user explicitly stating their preference.

    • Even if you guess a preferred locale, always allow an explicit user preference to override that. There’s nothing more frustrating than moving between pages, and having the site decide that it knows better what language you understand πŸ™‚

    • As long as you make it easy to switch between sites, you shouldn’t need a specific landing page. It doesn’t hurt to pop up a banner if you’re unsure whether you should redirect a user (for example, amazon.com will show a banner to a UK user, giving them the option of switching sites – but not deciding for them)

    How should you structure your URLs?

    Having the language somewhere in the URL (either as a subdomain or a folder) is probably best for SEO. Don’t forget to update your sitemap as well, to indicate to crawlers that there are alternate content pages in different languages.

    Login or Signup to reply.
  4. As a precondition, I assume that you are not using frameworks / libraries. Furthermore, I never have solved similar problems only using .htaccess (as the title of your question requests) and thus don’t know if it is possible to do so. Nevertheless, the following guidelines may help you.

    Your first question

    In general, a web page’s file name and path have influence on its ranking. Furthermore, having page names and paths in native languages might help your users memorize the most important of your URLs even without bookmarking them.

    Nevertheless, I never would translate the page names or directories for pages which are part of a web application (as opposed to a informational or promotional pages).

    The login page you mentioned is a good example. I am nearly sure that you do not want your site to be found because of its contents on its login page. Actually, there are many websites which exclude login pages and other application pages from being indexed at all.

    Instead, in SEO terms, put your effort into your promotional and informational pages. Provide valuable content, explain what is special about you or your site, and do everything you could that those pages get properly indexed. IMHO, static HTML pages are the best choice for doing so.

    Furthermore, if you translate the names of pages which belong to your actual application, you will run into massive trouble. For example, after successful login, your application probably will transfer the user to his personal dashboard, which probably will be based on another HTML template / page. If you have translated that page name into different languages, then your application will have to take care to take the user to the right version. Basically, that means that you need as many versions of your application as languages you want to support. Of course, there are tricks to make life easier, but this will be a constant pain and definitely in no way worth the effort.

    To summarize: Create static pages which show your USP (unique seller position) and provide valuable content to users (for example sophisticated tutorials and so on). Translate those pages, including names and paths, and SEO them in every way you could. But regarding the actual application, optimizing its pages is kind of pointless and even counterproductive.

    Your second question

    I would never use IP based redirecting for several reasons.

    First, there are many customers in countries which are not their home country. For example, do you really want to redirect all native English speakers to your Hungarian pages because they are currently in Hungary for a business trip?

    Second, more and more users today are using VPNs for different reasons, thereby often hiding the country where they currently are.

    Third, which IP address belongs to which provider or country is highly volatile; you would have to constantly update your databases to keep up.

    There are more reasons, but I think you already have got the idea.

    Fortunately, there is a solution to your problem (but see “Final remark” below): Every browser, when fetching a page from a server, tells the server the preferred and accepted languages. For example, Apache can directly use that information in RewriteRule statements and redirect the user to the correct page.

    If you can’t alter your Server’s configuration, then you can evaluate the respective header in your CGI program.

    When doing your research, look for the Accept-Language HTTP 1.1 header. A good starting point probably is here.

    Your third question

    You eventually are mixing up two different things in your third question. A locale is not the same as a language. On one hand, you are asking “…to get the local from…”, and on the other hand, you say “…lang=fr…”, thus making the impression you want to get the language.

    If you want to get the language: See my answer to your second question, or parse the language from the current path (as you already have suggested).

    If you want to get the locale, things are more complicated. The only reasonable automatic method is to derive the locale from the language, but this will often fail. For example, I generally prefer the English language when doing research, but on the other hand, I am located in Germany and thus would like dates and times in the format I am used to, so deriving my desired locale from my preferred language will fail.

    Unfortunately, there is no HTTP header which could tell the server which locale the user prefers. As a starting point, this article may help you.

    See the final remark (next section) on how to solve this problem.

    Final remark

    As the article linked above already states: The only reliable way to satisfy the user is to let him choose his language, his locale and his time zone within your application. You could store the user’s choices either in cookies or in your back-end database; each has its own advantages and disadvantages.

    I usually use a combination of all methods (HTTP headers, cookies, database) in my projects.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search