multi stores in magento root directory not correct

500 Views Asked by At

So I set up a subdomain. copied the index.php and the access file to the directory. Followed the basic instructions which included changing the root domain so the mage.php file was pointed correctly.

But, when I load my subdomain I get the following error:

/home/userID/public_html/subdomainfolder/home/userID/public_html/app/Mage.php was not found

It looks like it's not pointing my root domain correctly, but I'm not sure why. I'm hoping someone can help me out!

Here's the index.php I modified.

define('MAGENTO_ROOT', getcwd());

$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
if (file_exists($compilerConfig)) {
include $compilerConfig;
}

$mageFilename = MAGENTO_ROOT . '/home/user/public_html/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);

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE']    : 'subdomain';

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'website';



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

I added this to my .htaccess

SetEnvIf Host www\.sub.domain\.com MAGE_RUN_CODE=subdomain

SetEnvIf Host www\.sub.domain\.com MAGE_RUN_TYPE=website

SetEnvIf Host ^sub.domain\.com MAGE_RUN_CODE=subdomain

SetEnvIf Host ^sub.domain\.com MAGE_RUN_TYPE=website
0

There are 0 best solutions below