1

Magento's store URL wuery param is really annoying me and I'm not sure of the point of it when there is a store cookie for holding this info, also it only appears when you first visit a site or switch store views.

I would like to remove it as I think it may not work well with SEO & Search Engine Indexing. Also it looks bad!

I tried changing the setting on System > Configuration > Web > URL OPTIONS > Add Store Code to Urls to Yes but this is bad in another way as the default store view code and others are appended to every url. SEO duplicated content.

I don't know. Is there good logic behind how Magento is working that I'm not getting or can I remove this?

I tried the Bubble_HideDefaultStoreCode module to remove store codes but it did not.

I'm thinking maybe I can remove these URLS params with an NGINX re-write but am not sure how I can do this?

3 Answers 3

3

To remove this format: ?___store=english for english

Step 1 : Go to system->Configuration. Then go to web tab. You can see there is an option ' "Add Store Code to Urls" set that option to "Yes"

Step 2 : /app/design/frontend/base/default/template/page/switch/languages.phtml find this below code :

echo $_lang->getCurrentUrl()
Add 'false' as parameter
echo $_lang->getCurrentUrl(false)

Step 3 : Copy app/code/core/Mage/Catalog/Block/Widget/Link.php to app/code/local/Mage/Catalog/Block/Widget/Link.php

Search this line :
$this->_href = $this->_href . $symbol . "___store=" . $store->getCode();


And modify to : 
$this->_href = $this->_href;

Step 4 : Go to Admin panel locate navigation system->Index Management >> Reindex Data

1

The client sends a cookie to the server to tell which store should be delivered. But it's the server that sets the cookie. That's why, on initial request, the store code needs to be sent in a different way, i.e. by appending it as query parameter.

With that in mind you could try to set the cookie value client-side once the user changes the store switcher (before the request is triggered) and thus omit the query parameter.

Consider this an approach rather than a solution. I am not 100% sure if this covers the whole scenario or is technically feasible.

1

I know the question is old, but if anybody needs this functionality yet and you do not want to change any files I forked module on Github and added some improvements.

You can also use composer to install it.

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.