In order to get closer to users, large web stores usually support several store views based on specific language. By default, the same URL in Magento can display different locale interface which is, obviously, a bad thing for search engines and SEO. Using separate domain names for that matter does not always suite shop owners, and to say more, is not worth it.
Alternatively, it is possible, and recommended, to use the Magento default setting "Add Store Code to Urls". However, there is a downside: it has the Global Scope only. In other words, a default store code can't be excluded from the URL. And this applies to any other non-default store view codes. As a result, the website gets duplicates, an unsightly URL for default store view.
Whatever solution to address the issue you may find on the internet is tricky to implement, provided as is without any guarantee, and involves interference in a regular workflow of the server (workaround).
This all, along with bumping into serious Magento 2 bugs, led to us developing a proper solution that is easy to implement and works properly. It provides means to set "Add Store Code to Urls" under specific Scope. No need to say more!
Successful installation of the extension automatically modifies the scope of the setting below. Instead of Global, you should see Store View.
• Stores → Configuration → Web → Url Options → Add Store Code to Urls
Our recommendation is to keep this setting unmodified under the Default Values Scope. Now switch to a particular Store View and enable the setting if needed.
All set? Time to check it out!
• Fix for an annoying issue with default store switcher: no more redirects to the home page when you change the store via the built-in store switcher - the module preserves a complete URL;
• Fix for another store switcher's issue that occurs after switching back to the default store view;
• Automatic redirects to proper URLs. Website's old links are not a problem anymore, i.e the ones like www.example.com/default/product.html, appearing in Google search results or any other resources after you've disabled a store code for a given store. The extension automatically manages 301 redirect so that the user gets to a proper URL without /default/ > www.example.com/product.html.
- Enables store code in URL only for selected store view
- Provides full and correct technical integration
- Doesn't require any special server tune-up
- Keeps the initial URL when switching stores via the store switcher, without redirecting to the home page
- Addresses the issue with the store switcher when switching back to default store view
- Automatically performs redirects if the URL entered contains the store code but the store code setting is off
CompatibilityMagento Open Source (CE) 2.2.x, 2.3.x, 2.4.x
Magento Commerce (EE) 2.2.x, 2.3.x, 2.4.x
We provide comprehensive product support for all the Magento extensions available on this site starting from the moment of your purchasing them. If you need help on the extensions installation or on any issues relating to our products, our dedicated team of proven technical experts is at your service, ready to assist you at any time.
Changelognew feature bugfix
- v.2.1.10 (May 4, 2022)
- Added support for Magento 2.4.4;
- Implemented declarative schema.
- v.2.1.9 (Sep 3, 2021)
- Minor code improvements.
- v.2.1.8 (Aug 21, 2020)
- Added support for Magento 2.4.0.
- v.2.1.7 (Jun 2, 2020)
- Added support for Magento 2.3.5.
- v.2.1.6 (Dec 20, 2019)
- Added support for Magento 2.3.3.
- v.2.1.5 (Jul 13, 2019)
- Improved compatibility with Magento 2.3.1.
- v.2.1.4 (Jan 24, 2019)
- Improved compatibility with Magento 2.1-2.3.
- v.2.1.3 (Jan 23, 2019)
- Added compatibility with Magento 2.3.
- v.2.1.2 (Jan 11, 2019)
- Addressed an issue while switching CMS pages.
- v.2.1.1 (Nov 22, 2018)
- Improved compatibility with Magento 2.1.x.
- v.2.1.0 (Nov 20, 2017)
- Added compatibility with Magento 2.2.x.
- v.2.0.1 (Nov 16, 2017)
- Fixed an issue with infinite redirect on a default storeview's home page in Magento 2.1.10.
- v.2.0.0 (Apr 17, 2017)
- Initial release.