I have a staging environment using Magento Community, where I want to set up an additional New Zealand store. The site which redirects to the magento site is not loading the New Zealand store, but loads the default store instead. The following are the steps taken to set up the multi-store:

  1. Set up a temporary re-direct from my domain to Magento site in cPanel
  2. Created a new website
    1. Name - Pharmadeal NZ
    2. code - kiwi
    3. sort order - 2
  3. Created a Store view
    1. Name - New Zealand Store
    2. Code - pharmadeal_nz
    3. sort order - 2
  4. Added the domain to the secure and insecure url paths and changed the default country in the nz website
  5. Edit the .htaccess file following this sites as a reference.

    RewriteBase /magento/:

    RewriteCond %{HTTP_HOST} .mysite.com.au [NC] RewriteRule . - [E=MAGE_RUN_CODE:kiwi]

    RewriteCond %{HTTP_HOST} .mysite.com.au [NC] RewriteRule . - [E=MAGE_RUN_TYPE:pharmadeal_nz]

  6. Then updated the index.php file with the details below:

    /* Store or website code */ $mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';

    /* Run store or run website*/ $mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : '';

    switch($_SERVER['HTTP_HOST']) { case 'mysite.com.au': case 'www.mysite.com.au': $mageRunCode = 'kiwi'; $mageRunType = 'pharmadeal_nz'; break; }

    Mage::run($mageRunCode, $mageRunType);

This is not the first time I have tried to set up the multi store and I have been trying to find an answer as to how my setup is incorrect. I would like to have this issue solved once and for all, so I am now putting it out there for the good people of stackexchange to answer my question.

Your Answer

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

Browse other questions tagged or ask your own question.