For the creation of multistore magento we use following code

$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
Mage::run($mageRunCode, $mageRunType);

What will be the difference if we use website instead of store in $_SERVER['MAGE_RUN_TYPE'] : 'store'; code

2 Answers 2


I want to correct KESHAV_PHP here.

$_SERVER['MAGE_RUN_TYPE'] defines the type of entity which is used to select the store in the end. If you define a specific store by passing here store, then the store is loaded. This means espacially (in contradiction to what keshav wrote), that it doesn't matter wether the store is part of the default website or not.

If you pass website, then the store is loaded which is default for the website.

$_SERVER['MAGE_RUN_CODE'] defines the code of the website or store, as defined in the tables core_website.code and core_store.code.

The whole process can be found here:

switch ($scopeType) {
        case 'store':
            $this->_currentStore = $scopeCode;
        case 'group':
            $this->_currentStore = $this->_getStoreByGroup($scopeCode);
        case 'website':
            $this->_currentStore = $this->_getStoreByWebsite($scopeCode);

Where getStoreByWebsite only gets the default group and then calls getStoreByGroup which gets the default store for the group.

  • Fabulous explanation.+1 for digging core :) Sep 1, 2014 at 1:59

Currently am also working on different website in magento site.In my project am creating three websites with stores that specific to website.

$server[mage_run_type]:website mean that when the site is load , magento load the website .

$server[mage_runtype]:store means that magento load the store of default website.


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.