0

I want to optimize the store view URL to maintain the SEO standards when switching the language view in Magento1.9 front end.

Example

localhost/magento/?___store=french&___from_store=german

To

localhost/magento/(some german string) like

localhost/magento/de_DE/

If Spanish

localhost/magento/(some spanish string)

I have tried this but no luck.

Any help much appreciated?

0

1 Answer 1

0

If you want to prefix all URLs with a string like de_DE, set that string as the store code (instead of german) and use the "Add Store Code To URL" configuration in the answer you linked. This way, the ___store and ___from_store parameters are not necessary anymore and Magento omits them.

More info: M1: Remove "?___store=default" from the URL

If you want to use this approach, you should ask your question more specifically. By just saying "no luck" nobody can help you because we don't know what you tried and what was the problem.


But if you only want to change the URL that is used to switch stores and not all URLs, it is going to be complicated.

As long as you're okay with the language switcher always linking to the homepage you could add a RewriteRule to your .htaccess file like this:

RewriteRule ^de_DE$ /?___store=german
RewriteRule ^fr_FR$ /?___store=french

Then change the switcher template to use these URLs.

For the home page, ___from_store is not necessary (for an explanation see again the answer linked above)

1
  • @ fschmengler I have modified the question, thanks for the answer and suggestions. I will try this approach. Commented Jul 26, 2016 at 9:25

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.