I'm using the geoplugin.com script for my php redirect. At the moment I'm redirecting based off country ip, but I also want to be able to do it based on city and state. Here's what I have atm:
PHP:
<?php
//country code redirect
require_once('geoplugin.class.php');
$geoplugin = new geoplugin();
$geoplugin->locate();
$country_code = $geoplugin->countryCode;
switch($country_code) {
case 'US':
header('Location: http://www.123.com/1/');
exit;
case 'CA':
header('Location: http://www.123.com/2/');
exit;
default: // exceptions
header('Location: http://www.123.com/0/');
exit;
}
?>