cancel
Showing results for 
Search instead for 
Did you mean: 

Multi Store setup sub folders?

Multi Store setup sub folders?

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.

6 REPLIES 6

Re: Multi Store setup sub folders?

It is surely possible.

You should:

  1. Setup these base URLs in the corresponding backend stores' settings.
  2. Setup your webserver to pass the proper MAGE_RUN_TYPE and MAGE_RUN_CODE environment variables from the webserver to the PHP interpreter.

Re: Multi Store setup sub folders?

Ok. You' told us what to do, but not how to do it. What are the steps?

Re: Multi Store setup sub folders?

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.

Re: Multi Store setup sub folders?

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.

Sindre M, CEO & Founder
ProperHost.com - The Magento Hosting Experts

Re: Multi Store setup sub folders?

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.

Re: Multi Store setup sub folders?

I don't understand your solution, can you to be more specific? Smiley Happy

 

thk