cancel
Showing results for 
Search instead for 
Did you mean: 

Redirect loop for second store activated

Redirect loop for second store activated

Hi, I'm helping out on a Magento site which has two stores, one with a .com domain for the base store in English and one with a .dk domain for a Danish version of the store (with a dk store code).

 

Until the upgrade from 1.9.2.2 to 1.9.2.3 all was fine. Those visiting the .dk domain would go to the Danish store and those visiting the .com site would to the base English store.


However, after the upgrade, there is now a redirect loop. I've flushed the cache within magento and deleted it in the Var folder but still get the error.


Looking at the code, this has been added to the .htaccess:

 

SetEnvIf Host .*base.* MAGE_RUN_CODE="base";
SetEnvIf Host www\.ilovenaturalhair\.dk MAGE_RUN_CODE=dk
SetEnvIf Host ^ilovenaturalhair\.dk MAGE_RUN_CODE=dk

 

And in the index.php, this is the code after umask (0);

 

/* 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';
switch($_SERVER['HTTP_HOST']) {
case 'ilovenaturalhair.dk':
case 'www.ilovenaturalhair.dk':
Mage::run('dk', 'store');
break;
default:
Mage::run();
break;
}

 

I've tried the site with just one set of the above code insertions in place (ie just the .htacess amendment or index.php addition but to no avail). For now, I've disabled the dk store.

 

Magento isn't normally my area so not sure if I'm missing something obvious here and any help would be greatly appreciated. The site is on shared hosting.