Magento – Removing Magento Store URLs Param ?__store=

store-idstore-viewurlurl-rewrite

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?

Best Answer

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

Related Topic