I have two domains:
DomainA.nl (with magento installation)
DomainB.nl (nothing installed; just a public_html folder with a .htaccess file)
DomainB.nl :
Content of the .htaccess file on DomainB.nl:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.DomainA\.nl
RewriteRule (.\*) http://www.DomainA.nl/$1 [R=301,L]
Above works; it succesfully redirects to DomainA
DomainA :
This is the domain with the Magento installation. With;
- 1 website
2 stores
- Store 1 has two storeviews
- 1: code = "mbv_nl" (DEFAULT STORE VIEW)
- 2: code = "mbv_en"
- Store 2 has one storeview
- 1: code = "test_nl"
- Store 1 has two storeviews
Index.php on DomainA :
This is the content of the LAST lines of the index.php file on DomainA
/* 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 'DomainB.nl':
case 'www.DomainB.nl':
$mageRunCode = 'test_nl';
$mageRunType = 'store';
break;
default:
$mageRunCode = '';
$mageRunType = 'store';
break;
}
Mage::run($mageRunCode, $mageRunType);
THE QUESTION: The redirect works BUT it redirects to the DEFAULT store view.
In the 'switch-case' scenario i know the default case is not necessary because the $mageRunCode and $mageRunType are already declared. I put it in for testing. Because when i fill the default case with "mageRunCode = 'test_nl'" the storeview gets loaded.
I am out of knowledge, so any help is VERY welcome :)