1

I have been following http://www.magentocommerce.com/boards/viewthread/71318/ to help me setup Dual TLDs on my server, pointing to one store, so that you can have effectively two base paths... domain.com and domain.co.uk as 2 seperate stores, but accessing one set of data etc etc (without just forwarding one to the other)

This is my folder structure enter image description here the .co.uk index sits under the .com which is situated on the root of the server (please ignore the folder labelled .com)...

According to the instructions, I need to do two things

1) change the index.php on my second TLD location to reflect my single magento stores Mage.php job done

2) change the last line to reflect my store code

"Next you change the website reference on the last-ish line. You enter the reference you gave that store in the Magento admin"

for those that can help, here is the full code as it sits on the .com TLD

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   Mage
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

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
 */
define('MAGENTO_ROOT', getcwd());

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

$mageFilename = MAGENTO_ROOT . '/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'] : '';

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

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

CLEARLY its the last few lines here, but I don't know what I need to set it to...

lookin in my magento store list, I have

You can see from my screen shots, that I added a new store, but is it a new website I should have added?

and change the section which says base to an alternative? perhaps the full URL?

I don't want to mess around too much in case I can't revert it you see

My options of adding site, store, storeview My options of adding site, store, storeview

My current setup with 2 stores My current setup with 2 stores

.com - store settings .com - store settings

.co.uk - store settings .co.uk - store settings

main website (website settings) main website (website settings)

need to get this live asap, so any help would be awesome... Hopefully others trying to do the same thing will learn from peoples input and collaboration here

Henry

Henry Aspden
  • 382
  • 2
  • 5
  • 15
  • perhaps its the 3rd to last line `$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';` which should have `base` in there, the code of my website? like `$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : 'base';` or do I need to setup a second website with an alternative code? – Henry Aspden Apr 25 '13 at 18:21

0 Answers0