Hi there,
I am setting up a site to serve both Australia and New Zealand. The content for both sites is managed within the one CMSMS installation. Does anyone know what would be the best way to re-direct to the appropriate home page based on the referrer URL? That is, I want mysite.com.au to automatically redirect to the australia home page, and mysite.co.nz to automatically redirect to the NZ home page. I was thinking it may involve editing index.php...
thanks
Re-direction based on referrer domain
Re: Re-direction based on referrer domain
In case anyone else needs to do this at some point, I created a user defined tag called 'redirect'. Here is what I put in it:
$domain = $_SERVER['HTTP_HOST'];
if( ($domain == 'www.mysite.com.au') || ($domain == 'mysite.com.au' ) )
{
header( 'Location: http://www.mysite.com.au/index.php?page=mysite-au-home' ) ;
}
else
{
header( 'Location: http://www.mysite.com.au/index.php?page=mysite-nz-home' ) ;
}
I then just put it in the content of the home page - seems to work pretty smoothly.
$domain = $_SERVER['HTTP_HOST'];
if( ($domain == 'www.mysite.com.au') || ($domain == 'mysite.com.au' ) )
{
header( 'Location: http://www.mysite.com.au/index.php?page=mysite-au-home' ) ;
}
else
{
header( 'Location: http://www.mysite.com.au/index.php?page=mysite-nz-home' ) ;
}
I then just put it in the content of the home page - seems to work pretty smoothly.