How To Add Store Code To URLs In Magento 2
Adding the store code to URLs in Magento 2 can be very useful for multi-language setups. This way, customers know exactly which version of the store they're browsing. For example, if you have English and French Store Views, URLs will look like this:
1. Enable Store Code in URL Options
To show the store code in your store’s URLs:
- Head into Admin -> Stores -> Configuration -> Web
- Expand the URL Options tab
- Uncheck Use System Value
- Set Add Store Code to URLs to Yes

2. Save and Flush Cache
After making this change:
- Click Save Config
- Flush the Magento Cache from Cache Management
- Reload the frontend to confirm the store code is now included in URLs
3. Find Your Store Code
If you’re unsure of the store code for a Store View:
- Navigate to Stores -> Settings -> All Stores
- Check the Code column under the Store/Store View name

✅ That’s it! Now your Magento 2 store will display the store code directly in the URL, making it clear which language or store view your customers are browsing.
Updated on: 18/09/2025
Thank you!
