I have One wholesaler folder in magento root in which one index.php file in that file i found this code

 * Compilation includes configuration file
$compilerConfig = 'includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;

$mageFilename = '../app/Mage.php';
$maintenanceFile = 'maintenance.flag';

if (!file_exists($mageFilename)) {
    if (is_dir('downloader')) {
        header("Location: downloader");
    } else {
        echo $mageFilename." was not found";

if (file_exists($maintenanceFile)) {
    include_once dirname(__FILE__) . '/errors/503.php';

require_once $mageFilename;



#ini_set('display_errors', 1);


/* 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'] : 'store';

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

Mage::run('wholesale', $mageRunType);

I am Upgrading Magento version. My Issue is my site is redirecting on live site when I put Mage::run('wholesale', $mageRunType); instead of //Mage::run($mageRunCode, $mageRunType); in index.php.

Actually, i don't know actual use of $mageRunCode.

  • 1
    Your solution is here : magento.stackexchange.com/questions/71476/… – Padhiyar Gaurang Sep 5 '17 at 12:07
  • not working @padhiyargaurang – Jaimin Sep 5 '17 at 12:22
  • Hello, i am sure that your entries for web/secure/base_url and web/unsecure/base_url in table core_config_data is pointing to old url. Please remove cache also after this. Use like this select * from where path like '%web/%'; In that entries it will ponting to old url. – Padhiyar Gaurang Sep 5 '17 at 12:30

stoe For this : Actually, i don't know actual use of $mageRunCode.

$mageRunCode = 'your store code'

Magento need store code and store type to run. first param is store code and second ($mageRunType) is type of run website weather as store or webiste.

So $mageRunType is

1) store


2) website.

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