1

Just checked in my Google Webmaster Tools and found that there were a large amount of Not found products.

I am running a multilingual store with 2 languages.

Google has correctly identified product links, but they are missing the language identifier.

Example:

Product X has a URL KEY product-xyz.html

Google has indexed product-xyz.html and not /eng/product-xyz.html

How do I create a redirect for the URL key to automatically add /eng/ when a products URL key is used?

3

URL Rewrite

Assuming, that all your products only belong to one store, there is still no way to achieve this.

The problem is, that magentos rewrites in core_url_rewrite are store independant. This means the standard magento rewrite system doesn't help you here.

Observer

I would implement an observer, listen on controller_front_init_before and check before ANYTHING happens inside of magento, whether the product exists (load by url_key), in which store it is activated, CACHE this information and then redirect to the correct url.

To the cache, you should add the correct cache tag, for products in general and the specific product, so it gets cleared, when the product is changed.

.htacces / mod_rewrite

If you only have one storeview you could just send him from baseurl/<whatever> to baseurl/<storeviewcode>/<whatever>

Copied from the comment to make it more visible

  • Would there be a way to do this via .htaccess? Anything not arriving in the store as /eng/ that is not valid (such as a folder) to take the request and place /eng/ infront? – SR_Magento Apr 1 '14 at 14:25
  • of course, if you only have one storeview you could just send him from baseurl/<whatever> to baseurl/<storeviewcode>/<whatever> – Fabian Blechschmidt Apr 1 '14 at 18:44
0

I guess you have missed to check this

https://stackoverflow.com/questions/9176278/magento-redirect-to-specific-store-view

Does that help?

  • Thanks for the answer, however not the same problem. The issue is specific URL keys that are accessed that need to be redirected to a store view. – SR_Magento Apr 1 '14 at 11:53

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.