We got a problem with our Magento Store and the Multi Domain System + Stores.
We created 3 domains like:
- domain1.com
- domain2.com
- domain3.com
All domains have own stores and storeviews.
In the Configuration Tab of the Admin Panel we set the Base URLs for secure and unsecure to the URL of each domain.
Our domains pointing into the root dir of the magento installation.
We tried to edit the .htaccess file of the Magento like in this tutorail :
http://www.ecommercegorilla.com/how-to-set-up-multiple-store-fronts-with-magento/
Without any success.
We tried to edit the index.php but after we did this and uploaded the new index.php we got an empty browser tab which is pointing into our root dir of magento.
This is our code from the index.php:
<?php
/**
if (version_compare(phpversion(), '5.2.0', '<')===true) {
echo '<div style="font:12px/1.35em arial, helvetica, sans-serif;"><div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;"><h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 5.2.0 or newer. <a href="http://www.magentocommerce.com/install" target="">Find out</a> how to install</a> Magento using PHP-CGI as a work-around.</p></div>';
exit;
}
/**
* Error reporting
*/
error_reporting(E_ALL | E_STRICT);
/**
* Compilation includes configuration file
*/
$compilerConfig = 'includes/config.php';
if (file_exists($compilerConfig)) {
include $compilerConfig;
}
$mageFilename = 'app/Mage.php';
if (!file_exists($mageFilename)) {
if (is_dir('downloader')) {
header("Location: downloader");
} else {
echo $mageFilename." was not found";
}
exit;
}
require_once $mageFilename;
#Varien_Profiler::enable();
if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
Mage::setIsDeveloperMode(true);
}
#ini_set('display_errors', 1);
umask(0);
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
if(!isset($_SERVER['MAGE_RUN_CODE']) || !isset($_SERVER['MAGE_RUN_TYPE'])) {
switch($_SERVER['HTTP_HOST'] {
case 'domain3.com':
case 'www.domain3.com':
$mageRunCode = 'domain3_de';
$mageRundType ='website';
break;
case 'domain2.com':
case 'www.domain2.com':
$mageRunCode = 'domain2_de';
$mageRundType ='website';
break;
case 'domain1.com':
case 'www.domain1.com':
default:
$mageRunCode = 'base';
$mageRundType ='website';
break;
}
}
Mage::run($mageRunCode, $mageRunType);
is there a problem with our index.php ?!? We are glad for any help.
Kind regards