Display store code in URLs only for selected store views.
OverviewBack to top
In order to get closer to users, large web stores usually support several store views in different languages. By default in Magnto, the same URL can display the page with different locale interfaces which is, obviously, a bad thing for search engines and SEO. Using separate domain names does not always suit shop owners and, to say more, is not worth it.
Alternatively it is possible, and even recommended, to use the Magento default feature activated by the setting "Add Store Code to Urls". However, there is a downside: the scope of the setting is Global only. This means there’s no way to selectively exclude default store code from URL as well as any other store view codes. As a result, the website gets duplicates and an unsightly URL for the default store view.
Any means one can find on the internet to address the issue are complex to implement, not guaranteed to work properly, and involve interference in server’s regular workflow (a workaround).
With the problem surfaced and having bumped into some serious bugs in Magento 2 itself, we've developed a solution easy to implement and properly working. The extension enables admin to set "Add Store Code to Urls" under specific Scope. No need to say more!
Taking into account the problem surfaced and having bumped into some serious bugs in Magento 2 itself, we've developed a solution easy to implement and working properly. The extension enables admin to enable "Add Store Code to Urls" under specific Scope. Bang!
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
We suggest you keep the setting unchanged 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!
Extra functions of the extension:
- A fix for the annoying issue with the default store switcher: whenever you switch the store with help of the built-in store switcher, the module keeps the complete URL and doesn't redirect you to the home page;
- A fix for another issue with the store switcher when switching back to the default store view;
- Automatic redirects to proper URL: no worries about website's old links, ones like www.example.com/default/product.html, remaining in Google search results or some other resources if you turned off the store code for the given store. The extension automatically manages 301 redirect so that a user gets to a proper URL without /default/ -> www.example.com/product.html.
- Enables a 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 an 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
Release NotesBack to top
- Compatible with CE: 2.1 2.2
- Stability: Stable Build
Added compatibility with Magento 2.1.10 / 2.2.x
- Compatible with CE: 2.0 2.1
- Stability: Stable Build