0

Let's assume we have the following situation: 1 Magento website with 2 stores (EN - default, IT) and 1 product.

A user is accessing the website and the default store view is loaded (EN). The user visits the product page (website.com/boat.html) and then, from the same page, he switches the store to IT. All good, the new URL is loaded (website.com/barca.html).

He shares the IT product URL with a friend (website.com/barca.html), but when the friend opens the link (having the EN store view as the default one), the search page is opened with no results instead of the EN product URL.

As a solution, we can create separate URL Rewrites for each store view: for EN website.com/barca.html => website.com/boat.html and vice-versa for the IT store view.

So, I have 2 questions related to this:

  1. Are there any other solutions to this problem? I think of intercepting the store view event and determining the correct URL based on the target store view.
  2. Are 301 Permanent redirects the correct solution, instead of having a 302 Temporary redirect, from an SEO perspective?

Thank you!

1 Answer 1

1

Yes. You can create redirection rules (store-wise) and redirect to the correct URL for the targeted store. However, this is only feasible for limited products.

For a larger product set or a bunch of products, it can be achieved by creating an observer. Need to determine the product first by checking the URL against the rewrite table and then fetching the product URL for the targeted store.

Keeping SEO in mind, 301 redirection is suggested over the 302 temporary redirection.

2
  • Is "controller_action_predispatch" the event to be used?
    – str
    May 15 at 8:34
  • @iupaem, yes. But please keep in mind that this observer will be triggered on each page load and will check against the rewrite table every time. May 16 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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