<?php
$rexgeoip = new RexGeoIp;
$iso = strtoupper( $rexgeoip->getCountryIso() );
switch ($iso) {
case 'DE':
header("Location: http://www.domain.de/en/",TRUE,301);
break;
case 'AT':
header("Location: http://www.domain.de",TRUE,301);
break;
case 'CH':
header("Location: http://www.domain.de",TRUE,301);
break;
default:
header("Location: http://www.domain.de/en/",TRUE,301);
break;
}
}
echo "<!-- your iso is $iso -->";
?>
This is my code which redirects to the corresponding domain path. I changed the DE case to /en because I'm in Germany and want to test the redirect. But every time I hit with DE ISO I get a "to many redirects" timeout. This also happens if I connect via a web-proxy from US or Asia.
Any ideas or suggestions?