Mercurial > hg > ywww
diff index.php @ 42:3f400072bf14
merge, involved ediff3 wrt getAmazonInfo.php
author | Charlie Root |
---|---|
date | Sat, 05 Jan 2019 06:21:12 -0500 |
parents | 1bb0bc3d306a |
children | dbc006408d2b |
line wrap: on
line diff
--- a/index.php Sun Jul 30 05:36:48 2017 -0400 +++ b/index.php Sat Jan 05 06:21:12 2019 -0500 @@ -1,31 +1,42 @@ -<?php - $country_code = $_SERVER["GEOIP_COUNTRY_CODE"]; - switch($country_code){ - /* case "CA": - Header( "HTTP/1.1 301 Moved Permanently" ); - Header ("Location: http://www.yournextread.com/ca/" ); - break; - case "DE": - Header( "HTTP/1.1 301 Moved Permanently" ); - Header ("Location: http://www.yournextread.com/de/" ); - break; - case "FR": - Header( "HTTP/1.1 301 Moved Permanently" ); - Header ("Location: http://www.yournextread.com/fr/" ); - break; - case "GB": - Header( "HTTP/1.1 301 Moved Permanently" ); - Header ("Location: http://www.yournextread.com/uk/" ); - break; - case "US": - Header( "HTTP/1.1 301 Moved Permanently" ); - Header ("Location: http://www.yournextread.com/us/" ); - break; */ - default: - Header( "HTTP/1.1 301 Moved Permanently" ); - Header ("Location: http://www.yournextread.com/us/" ); - break; - } +<?php + +if (isset($_SERVER["GEOIP_COUNTRY_CODE"])) { +$country_code = $_SERVER["GEOIP_COUNTRY_CODE"]; + } +elseif (isset($_SERVER["REDIRECT_GEOIP_COUNTRY_CODE"])) { +$country_code = $_SERVER["REDIRECT_GEOIP_COUNTRY_CODE"]; + } + else {$country_code = "US" ; } +file_put_contents('/var/ywww/debug/phpDebug', + "cc: $country_code\n", + FILE_APPEND); + +switch($country_code) { + case "CA": + Header( "HTTP/1.1 301 Moved Permanently" ); + Header ("Location: http://www.yournextread.com/ca/" ); + break; + case "DE": + Header( "HTTP/1.1 301 Moved Permanently" ); + Header ("Location: http://www.yournextread.com/de/" ); + break; + case "FR": + Header( "HTTP/1.1 301 Moved Permanently" ); + Header ("Location: http://www.yournextread.com/fr/" ); + break; + case "GB": + Header( "HTTP/1.1 301 Moved Permanently" ); + Header ("Location: http://www.yournextread.com/uk/" ); + break; + case "US": + Header( "HTTP/1.1 301 Moved Permanently" ); + Header ("Location: http://www.yournextread.com/us/" ); + break; + default: + Header( "HTTP/1.1 301 Moved Permanently" ); + Header ("Location: http://www.yournextread.com/us/" ); + break; + } ?> <html> <head> @@ -35,5 +46,6 @@ <meta name="google-site-verification" content="0XCtbGM_bvOH363P2XE6DVjh-APTICOREquY8F38T84" /> </HEAD> <body> +<script src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US&adInstanceId=322bafc0-69fa-4664-8e1c-0b9159259748"></script> </body>