Articles on: Magento 2 User Guide

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:


  1. Head into Admin -> Stores -> Configuration -> Web
  2. Expand the URL Options tab
  3. Uncheck Use System Value
  4. Set Add Store Code to URLs to Yes


Magento 2 add store code to URLs



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:


  1. Navigate to Stores -> Settings -> All Stores
  2. Check the Code column under the Store/Store View name


Magento 2 check store view code



✅ 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

Was this article helpful?

Share your feedback

Cancel

Thank you!