I'm working on project which involve magento multistore. I know how it works inside magento, but have no clue how to set up Open Server for this.
Any guesses?
Add on:
I have two stores on one magento. They use their own url's.
I had an idea, what aliases could help, but they don't.
In my understanding, each url should change server variables: MAGE_RUN_CODE and MAGE_RUN_TYPE. Well, at least MAGE_RUN_CODE. I can freely edit index.php, if this help, it's not a part of repository.
I could edit an apache ini config of Open Server, but Open Server is overwrites any changes in this files at each server run. Maybe htaccess can help, but I don't know if I can input $_SERVER['MAGE_RUN_CODE'] variable in it. This is there I stop.


1 Answer 1


Well, I've managed to do it.
First, in my solution, I have to switch in Open Server Apache module to 2.4 version, and PHP module to 5.5 version, since it was a must.
Second, I've added this lines to htaccess:

<If "%{HTTP_HOST} == 'tpw.dev'">
    SetEnv MAGE_RUN_CODE chlp_website
    SetEnv MAGE_RUN_TYPE website
<If "%{HTTP_HOST} == 'pilgrim.tpw.dev'">
    SetEnv MAGE_RUN_CODE pilgrimp_website
    SetEnv MAGE_RUN_TYPE website

And to link pilgrim.tpw.dev to directory with code, I've added it in the Open Server Parametres window, tab Domains. This was really that simple.
Soon after I've found, what I could use SetEnvIf in htaccess instead of If (they are pretty same, but SetEnvIf can be used in Apache 2.2), or check domain name in index.php file (if you need to emulate nGinx setup, or when htaccess isn't working) with the same result.
Since my work is not sensetive to versions of the modules, I left my first approach to handle.

Your Answer

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

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