I want to have a single website with a single domain/URL. Under that website I want to have two stores, each of which will have one single store view.

One store is intended for regular browser clients, and the other store is for clients which use a specific mobile app which has its own browser with a unique user agent. The people I'm building this for want to showcase different products in that app.

I'm running Magento2 with nginx 1.8 and php-fpm 7.0

I thought I could set this up by modifying my index.php as seen in numerous examples. Even the official documentation shows this, saying that I need to set MAGE_RUN_TYPE to either store or website and MAGE_RUN_CODE to the one that I want.

My problem is that I cannot figure out what to set as value for MAGE_RUN_CODE! Looking in the backend and database, stores (db table store_group) don't have a code! Only websites and store views have a code, and every single example I can find on the internet uses MAGE_RUN_TYPE='website' which doesn't help me.

How do I tell Magento which store I want to show?

1 Answer 1


You doesn't need to do anything MAGE_RUN_TYPE='website' for your requirements.

Its needed when you have to require two different websites with differnt domain name.

In your case you doen't need two different domain so you dont need to do changes in index.php file.

  • I know that I don't need MAGE_RUN_TYPE='website', in my question I complained that every example on the internet is always about that, but never about what I need. If I don't need to change index.php then how do I tell the system which store to use?
    – peedee
    May 19, 2016 at 1:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.