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.
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.
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.