Mercurial > hg > ywww
diff index.php @ 20:7679346abfdb
get code and use it
| author | Charlie Root |
|---|---|
| date | Thu, 25 Oct 2018 09:40:25 -0400 |
| parents | 84a412b8122c |
| children | 1bb0bc3d306a |
line wrap: on
line diff
--- a/index.php Thu Aug 30 17:18:12 2018 -0400 +++ b/index.php Thu Oct 25 09:40:25 2018 -0400 @@ -1,7 +1,8 @@ <?php - $country_code = $_SERVER["GEOIP_COUNTRY_CODE"]; + try {$country_code = $_SERVER["GEOIP_COUNTRY_CODE"]; + } catch(Exception $e) { $country_code = "US" ; } switch($country_code){ - /* case "CA": + case "CA": Header( "HTTP/1.1 301 Moved Permanently" ); Header ("Location: http://www.yournextread.com/ca/" ); break; @@ -20,7 +21,7 @@ case "US": Header( "HTTP/1.1 301 Moved Permanently" ); Header ("Location: http://www.yournextread.com/us/" ); - break; */ + break; default: Header( "HTTP/1.1 301 Moved Permanently" ); Header ("Location: http://www.yournextread.com/us/" );
