Mercurial > hg > ywww
comparison 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 |
comparison
equal
deleted
inserted
replaced
19:84a412b8122c | 20:7679346abfdb |
---|---|
1 <?php | 1 <?php |
2 $country_code = $_SERVER["GEOIP_COUNTRY_CODE"]; | 2 try {$country_code = $_SERVER["GEOIP_COUNTRY_CODE"]; |
3 } catch(Exception $e) { $country_code = "US" ; } | |
3 switch($country_code){ | 4 switch($country_code){ |
4 /* case "CA": | 5 case "CA": |
5 Header( "HTTP/1.1 301 Moved Permanently" ); | 6 Header( "HTTP/1.1 301 Moved Permanently" ); |
6 Header ("Location: http://www.yournextread.com/ca/" ); | 7 Header ("Location: http://www.yournextread.com/ca/" ); |
7 break; | 8 break; |
8 case "DE": | 9 case "DE": |
9 Header( "HTTP/1.1 301 Moved Permanently" ); | 10 Header( "HTTP/1.1 301 Moved Permanently" ); |
18 Header ("Location: http://www.yournextread.com/uk/" ); | 19 Header ("Location: http://www.yournextread.com/uk/" ); |
19 break; | 20 break; |
20 case "US": | 21 case "US": |
21 Header( "HTTP/1.1 301 Moved Permanently" ); | 22 Header( "HTTP/1.1 301 Moved Permanently" ); |
22 Header ("Location: http://www.yournextread.com/us/" ); | 23 Header ("Location: http://www.yournextread.com/us/" ); |
23 break; */ | 24 break; |
24 default: | 25 default: |
25 Header( "HTTP/1.1 301 Moved Permanently" ); | 26 Header( "HTTP/1.1 301 Moved Permanently" ); |
26 Header ("Location: http://www.yournextread.com/us/" ); | 27 Header ("Location: http://www.yournextread.com/us/" ); |
27 break; | 28 break; |
28 } | 29 } |