Magento - Force store code extension
Overview
Activating "Add Store Code to Urls" in Magento back office will let your main URL available, even without store code., (*1)
This extension checks, only for the home page, if the store code is in URL. If it is not, it redirects (301) to "base URL + current website's default store view code"., (*2)
This extensions does only manage home page, not internal pages, because for them, Magento automatically adds store code in URL., (*3)
Compatibility
Tested on Magento CE 1.6 - 1.9, (*4)
Notes
- Free and open source
- Fully configurable
- Bundled with English and French translations
Installation
No Magento files will be modified, no extended class, no overridden method., (*5)
With modman
$ modman clone https://github.com/aurmil/magento-force-store-code.git
Manually
- Download the latest version of this module here
- Unzip it
- Move the "app" folder into the root directory of your Magento application, it will be merged with the existing "app" folder
With composer
- Adapt the following "composer.json" file into yours:
{
"require": {
"aurmil/magento-force-store-code": "dev-master"
},
"repositories": [
{
"type": "composer",
"url": "http://packages.firegento.com"
},
{
"type": "vcs",
"url": "git://github.com/aurmil/magento-force-store-code"
}
],
"extra": {
"magento-root-dir": "./"
}
}
- Install or update your composer project dependencies
Usage
In System > Configuration > General > Web > Url Options, this extension adds a new option: Force Store Code in Urls, (*6)
, (*7)
- Select "No" to stay with the Magento basic behavior
- Select "Yes" (default value) to activate the extension
Note: HTTP redirection may be cached by your browser if you had previously activated the extension so clean your cache after selecting "No" if redirection keeps being done., (*8)
License
The MIT License (MIT). Please see License File for more information., (*9)