To make a long story short I want to redirect visitors from one store view to another. I assume I can do it with following url http://sld.tld/?___store=code2&___from_store=code1. However it is not working. Stores views belong to different websites. All websites have same domain without any trailing codes.

My debugging led me to Mage_Core_Model_App where somewhere around lines 534-547 the following code can be found:

     * prevent running a store from another website or store group,
     * if website or store group was specified explicitly in Mage::run()
    $curStoreObj = $this->_stores[$this->_currentStore];
    if ($type == 'website' && $storeObj->getWebsiteId() == $curStoreObj->getWebsiteId()) {
        $this->_currentStore = $store;
    elseif ($type == 'group' && $storeObj->getGroupId() == $curStoreObj->getGroupId()) {
        $this->_currentStore = $store;
    elseif ($type == 'store') {
        $this->_currentStore = $store;

However I got no adjustments made to my index.php and $_SERVER['MAGE_RUN_CODE'] variable is not set.

So the question is what else can explicitly set the store view or what the hell is going on?

  • What's going on in App::_checkGetStore()? – benmarks May 28 '13 at 13:06
  • All stock. No mods. $storeObj is valid and active. – user487772 May 28 '13 at 13:22

All websites have same domain without any trailing codes.

It is a wrong part, you can't have 2 websites with the same domain and url in magento. You should either have separate domains or separate urls.

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.