Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

I dispair with multistore
 
Quaeso
Guru
 
Avatar
Total Posts:  334
Joined:  2010-04-03
 

Please apologize,… but I despair with my multistore configuration.
When I choose store2, I get an error

I don´t find what’s wrong :-(

I explain:

I need two shops, magento 1.5.0.1

-www.shop1.de
-www.shop2.de

in manage store is all right.

My Problem must be in the index.php. Here the code of index.php shop2. Shop1 I modify nothing.

..........

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

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

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

require_once $mageFilename;

#Varien_Profiler::enable();

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage
::setIsDeveloperMode(true);
}

#ini_set('display_errors', 1);

umask(0);
// this first line detects the domain / sub domain
switch($_SERVER['HTTP_HOST']{

/* store2
case 'shop2.de':
case 'www.shop2.de':

Mage::run('codeshop2', 'website');

break;

case 'shop1.de':
case 'www.shop1.de':

/
Mage::run('codeshop1', 'website');

break;
}
nothing else

or the .haccess - Here the code of .haccess shop2. Shop1 I modify nothing.

The last lines, in the bottom

############################################
SetEnvIf Host .*shop1.* MAGE_RUN_CODE="base";
SetEnvIf Host .*shop2.* MAGE_RUN_TYPE="website";

look at screenshots…

I would be happy about help.....please excuse my bad english.

Image Attachments
scrennshot-web.jpgscreenshot-error.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
Novusweb
Sr. Member
 
Avatar
Total Posts:  89
Joined:  2009-05-06
Texas
 

In 1.5 you do not have to modify anything in the index.php file to handle multiple store setup. The problem is in the code you used in your .htaccess file:

############################################
SetEnvIf Host .*shop1.* MAGE_RUN_CODE="base";
SetEnvIf Host .*shop2.* MAGE_RUN_TYPE="website";

For your purposes, I would suggest you use:

############################################
SetEnvIf Host *\.shop1\.* MAGE_RUN_CODE="shop1";
SetEnvIf Host *\.shop1\.* MAGE_RUN_TYPE="store";

SetEnvIf Host *\.shop2\.* MAGE_RUN_CODE="shop2";
SetEnvIf Host *\.shop2\.* MAGE_RUN_TYPE="store";

Provided that you have your Store Codes set to “shop1” and “shop2.”

 
Magento Community Magento Community
Magento Community
Magento Community
 
Novusweb
Sr. Member
 
Avatar
Total Posts:  89
Joined:  2009-05-06
Texas
 

PS: I’ve never used “*” in the SetEnvIf code, either. If what I gave you doesn’t work, try:

SetEnvIf Host www\.shop1\.de MAGE_RUN_CODE=shop1 
SetEnvIf Host www\
.shop1\.de MAGE_RUN_TYPE=store 
SetEnvIf Host 
^shop1\.de MAGE_RUN_CODE=shop1 
SetEnvIf Host 
^shop1\.de MAGE_RUN_TYPE=store

SetEnvIf Host www\
.shop2\.de MAGE_RUN_CODE=shop2 
SetEnvIf Host www\
.shop2\.de MAGE_RUN_TYPE=store 
SetEnvIf Host 
^shop2\.de MAGE_RUN_CODE=shop2
SetEnvIf Host 
^shop2\.de MAGE_RUN_TYPE=store
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top