I've Magento multilanguage store and I need to add store code to url. In this path System > Configuration > Web > Url Option > Add Store Code to Urls
I've turn ON
, then I see in url as such site.com/en (default), site.com/br (brazillian).
How I can remove EN in default site.com/en and get for default store site.com without EN path??
I have made a new extension available on GitHub that allows you to hide the default store code from URLs.
More information here: https://github.com/jreinke/magento-hide-default-store-code
By Default magento will only allow you to change this config option for the whole setup, you can't change it on a by store basis.
You can possibly update magento to allow you to specify different settings for this option per website to allow you to do what you need:
app/code/core/Mage/Core/etc/system.xml
Note, you should not change this file directly, but overrie it in your own module. You can find many tutorials out there for helping to override core magento configs and files.
if you updated the scope settings:
this will allow you to change the "Add Store Code to Urls" for each website/store front in the admin section.
Now you can try and set "Add Store Code to Urls" = NO for the default store and "Add Store Code to Urls" = YES for the others.
Please note I have not tested this, so I would not do this on a live store :)
I have an alternative solution that worked well too.
Copy
app/code/core/Mage/Catalog/Block/Widget/Link.php
toapp/code/local/Mage/Catalog/Block/Widget/Link.php
Search for (line 91 in Magento 1.7.x / line 100 in Magento 1.9.x)
And modify to
Upload and save your changes and you'll now not have your widget (dynamically) inserted links getting appended with ?___store=default.
Credit: DesignHaven