I have been searching for a week now trying to find out if this is even possible and if so how to do it. I know how to set it up in the admin panel but what needs to be done with the .htaccess or index.php files to get it to work.
We need to setup a multi store Magento 2 with the domain name / folder options in the example below.
store.mywebsite.com/usa/
store.mywebsite.com/canada/
store.mywebsite.com/europe/
I have found guides for using different domains or subdomains but nothing like my example above.
Does anyone know how I would do this?
Thanks in advance for any help you can offer.
It is surely possible.
You should:
Ok. You' told us what to do, but not how to do it. What are the steps?
I would also like info on the how to for this method. I have not been able to get is to work via other methods.
It depends on your server environment; which web server you are using (Apache, Litespeed, nginx,..) and how PHP is ran (mod_php, lsphp, php-fpm, etc..). If you give some more details about your specific server environment it is easier to give the exact steps. In some situations you can just add a couple of lines to the .htaccess file in order to load the correct store based on the url that was requested. In the case of nginx you have to add the appropriate lines to the vhost config file.
The way I got it to work is to leave all base urls the way they are, then in the default configuration I opted to add store code to url and not to automatically redirect to the base url. It seems to be working fine.
I don't understand your solution, can you to be more specific?
thk