cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Subdomains for each website

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Problem with Subdomains for each website

Hello,

I have a magento with 2 stores for each country.

I want an URL for the main site : site.com and one other for the South Africa site: za.site.com.

I have create one php file with this code:

<?
switch($_SERVER['HTTP_HOST']) {

	case 'www.za.site.com':
	case 'za.site.com':
	$_SERVER["MAGE_RUN_CODE"] = "za";
	$_SERVER["MAGE_RUN_TYPE"] = "website";
	break;

	case 'www.site.com':
	case 'site.com':
	$_SERVER["MAGE_RUN_CODE"] = "ch";
	$_SERVER["MAGE_RUN_TYPE"] = "website";
	break;
}

and in my index.php file i have at end:

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

ini_set('display_errors', 1);

umask(0);

include "subdomains.php";

/* 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'] : 'website';

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

And in admin config, in scope South Africa, i have change the Base URL and the Secure Base URL with: za.site.com

 

If I go to the url: germanier.com it's works, but with the url za.site.com i have this error:

Page Web inaccessible

ERR_NAME_NOT_RESOLVED

What I have doing wrong ?

 

Thanks in advance