0

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.

0

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>
<If "%{HTTP_HOST} == 'pilgrim.tpw.dev'">
    SetEnv MAGE_RUN_CODE pilgrimp_website
    SetEnv MAGE_RUN_TYPE website
</If>

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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