8

Hope one can help me out with this problem i'm facing.

Situation:

I've got 1 website in 5 languages (e.g. example.com, example.com/it etc.)

Problem:

Now I've got example.com/about-us and example.com/it/about-us. Obviously I want for the Italian version to be like: example.com/it/chi-siamo.

I've been trying to translate the identifier and linked it in product categories to lets say "chi-siamo". Problem is if you try to switch to a different language it takes that identifier.

For example: I'm currently at example.com/it/chi-siamo but I want to switch to the German version, which should be example.com/de/ueber-uns. If I'm switching from Italian to German using the language switch I get: example.com/de/chi-siamo. Which gives a 404.

What is the solution to go with?

4

There is no solution. Magento doesn't support that.

I wrote a module which checks the identifier and looks the translation in the config up, then it makes a redirect.

So you have two options:

  1. choose one language and use it for everything - don't translate the url
  2. implement some module which does what you want.

Instead of describing how to make this module have a look on this: https://github.com/klein0r/magento-language-routes

  • 2
    Mind sharing your module? – Simon May 6 '15 at 18:43
  • Sorry, I'm not allowed, if I were I would :) – Fabian Blechschmidt May 7 '15 at 15:02
  • @FabianBlechschmidt can you explain further. I would like to develop this module. You enter other stores urls in cms pages for each storeview? – jrosell Sep 1 '15 at 8:44
  • 1
    added a link to a module which should solve the problem, if it doesn't tell me, then I'll describe more in deep how to implement this. – Fabian Blechschmidt Sep 2 '15 at 17:40
  • 1
    Thanks. I found this module that i think i can adapt. github.com/tzyganu/CmsRewrites – jrosell Sep 4 '15 at 8:03
2

I am assuming that your five languages each have their own store view. If that is the case, you could implement this using Catalog > URL Rewrite Management for the products — one for each store_id — and then extending Mage_Catalog_Model_Product_Url::getUrl to look for a store-specific rewrite and use that request_path instead of the default.

  • Yes I'm using different store views. As I'm a bit of a Magento nooby, I'm not exactly sure what you mean. Would you mind giving me a step-by-step guide :) Would be wonderful. – el_machine May 13 '15 at 7:18
  • I don't see this problem in product pages but in cms pages. – jrosell Sep 1 '15 at 8:46
1

You should no do it.

  1. it adds another layer in the url processing. Gives the possibility of errors and performance bottlenecks.

  2. switching the language gets a lot harder, as you not only need to link to another language identifier, you also need to fetch the correct URLs for each language(for the case you have a language switch on your site)

  3. it has nearly no benefit. A lot of browsers today even start to hide the full url, only showing the domain, or even only the identifier on the ssl certificate.

  • Yet, for SEO it still matters according to my information? – Melvyn May 13 '15 at 19:20
0

If SEO is your main concern, then you should simply use the rel="alternate" hreflang="x" attributes in your header to tell the search engines (Google) that the page being viewed is an exact translation of another page.

Not only will Google start to index your translated pages but it will also remove any duplicate content penalties for any part of the page which is not translated.

First part is language and second is country ("it-it" Italian-Italy or "de-ch" German-Switzerland) if that is how you are targeting. Also always have a default set.

Example to put in head:

<link rel="alternate" href="example.com/about-us" hreflang="x-default" />
<link rel="alternate" href="example.com/about-us" hreflang="en-us" />
<link rel="alternate" href="example.com/it/about-us" hreflang="it-it" /> 
<link rel="alternate" href="example.com/de/about-us" hreflang="pt-pt" />

This is explains it pretty well :

https://support.google.com/webmasters/answer/189077?hl=en

https://moz.com/learn/seo/hreflang-tag

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.