Dear community,
I'm looking for a way to change the Store View Code to include a hyphen instead of an underscore. Our shop has several Stores (i.e. representing different countries) and with several Store Views (i.e. the available languages). The URL format should look like this:
Example 1 (UK - English): https://www.demostore.com/en-GB/
Example 2 (Germany - German): https://www.demostore.com/de-DE/
Example 3 (Germany - English): https://www.demostore.com/en-DE/
Basically, the format for the Store View Code is as follows: language-COUNTRY
What is the best approach to solving this issue? I could potentially change the Store View Code manually in the DB but I'm not sure whether this will cause other issues down the road.
Thanks!
Solved! Go to Solution.
do not change the store code to en-GB keep them to en_gb
all you need is the URL for your store as :
(UK - English): https://www.demostore.com/en-GB/
you can do that by following these steps:
kindly Accept as a Solution if this works for you and give Kudos
do not change the store code to en-GB keep them to en_gb
all you need is the URL for your store as :
(UK - English): https://www.demostore.com/en-GB/
you can do that by following these steps:
kindly Accept as a Solution if this works for you and give Kudos
Thank you for your help!
Sorry, I'm pretty new to Magento (have been working with an ASP.Net e-commerce shop the past 4 years, that's why I need a bit more guidance).
Steps 1 and 2 are clear.
Step 3 (create a folder en-GB) -> I assume create a folder in Magento main file directory, can you confirm?
Step 4 -> I created the above folder in the Magento main file directory and copied index.php and .htaccess over to the en-GB (in my case the folder is called "ch-DE") folder. Can you explain in more detail how I can " update the links into index.php with store code en_gb"?
Step 5 -> Inside the ch-DE directory, I created a directory pub including the two symlinks to the folders /pub/media/ and /pub/static/ (via the terminal and command "ln -s pub/media/ ch-DE/pub/media")
Hope you can further assist.
Cheers
you need to check your document root for Magento
Magento can run from the main folder as well as the pub folder.
it's recommended to run from the pub folder.
assuming you are using pub folder as a document root.
cd magentoRootDir/pub mkdir en-GB cp index.php en-GB/ cp .htaccess en-GB/ cd en-GB/ ln -s ../media ln -s ../static
now open en-GB/index.php
and update the following line
require __DIR__ . '/../app/bootstrap.php'; -> require __DIR__ . '/../../app/bootstrap.php';