Magento urls – remove the appended ?___store=

A typical Magentoism. If you are setting up multiple shop/store views within a website in Magento then you’ll notice if you use the store switcher to switch between them that Magento (by default) will append a pretty horrible looking;

 ?___store= 

parameter on the end of urls. Their alternative store will be http://www.myshop.com/?___store=otherstore but even worse, the default store when switched back will be http://www.myshop.com/?___store=default

Not only does it look bad seeing that sitting in your browser address bar but it’s not good from an SEO point of view. If you are Googling about this then you’ll probably see a raft of forum threads from Google Base / Google Merchant Centre users whinging mercilessly about this ‘Bug’ which Varien has neglected to fix.

It isn’t a bug at all, as is horribly common with Magento it’s user error in the configuration settings. Caused by a lack of understanding of the settings, but also to do with the topsy turvy way things are often explained in the back end.

In System -> Configuration -> Web -> URL Options the first item is ‘Add Shop Code to URLs’. That will be set to ‘No’ by default. Of course, anyone seeing this will assume that having that set to No means that the ‘?___store=’ part shouldn’t be appended to the url, but the opposite is the case. That parameter is used by Magento to display the correct store because it’s set to ‘No’, not in spite of it. Set it to ‘Yes’ and you’ll find that your store name will be incorporated in the url like;

http://www.myshop.com/otherstore/

http://www.myshop.com/default/

All that’s left to do is to change the ‘default’ shop code to something more SEO friendly in ‘System -> Manage Shops’.