Magento – Remove multi-language storeview code from the url – Magento1.9

languagemagento-1.9multistorestore-viewurl-rewrite

I am using Magento multistore view for multiple languages like english, german, french etc.

To have clean urls i have enabled the settings "Add Store Code to Urls" to "yes".

Now it shows following url for stores:

English: mystore.com/english/category1.html

German: mystore.com/german/category1.html

English language store is my default store. it loads when my site load first.
as it's default language i don't want to show english in the url.

So how can i remove the english from the default store view url?

The url for english should be:

English: http://mystore.com/category1.html

German: http://mystore.com/german/category1.html

Not sure how to do this.

Best Answer

Here is the solution

https://github.com/jreinke/magento-hide-default-store-code

Remove this format: ?___store=english for english and ?___store=arabic

In the design file find the languages.phtml

/app/design/frontend/default/template/page/switch/languages.phtml

In the line 41

echo $_lang->getCurrentUrl()

Add 'false' as parameter

echo $_lang->getCurrentUrl(false)

Actual Url:

http:example.com?___store=english for english and ?___store=arabic

After added the false parameter in $_lang->getCurrentUrl(false) method. Url will be generated like the below

http:example.com?___store=english

Related Topic