![]() |
redirecting traffic by country
Hello,
Tried the following geolite MaxMind and it redirected all my traffic to the redirect URL instead of just DE traffic. I just want DE (German) traffic redirected right now and if not DE continue on. <?php require_once('geoip.inc'); $gi = geoip_open('GeoIP.dat', GEOIP_MEMORY_CACHE); $country = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']); geoip_close($gi); $my_countries = array('de'); if (!in_array(strtolower($country), $my_countries)) { header('Location: http://www.google.com); } exit; } ?> Got the code from here: http://www.warriorforum.com/programm...s-country.html Help! (-: |
Change
if (!in_array(strtolower($country), $my_countries)) to if (in_array(strtolower($country), $my_countries)) remove the '!' |
That did it, many thanks!
|
Sure, I had the exact same problem before. :thumbsup
|
All times are GMT -7. The time now is 10:51 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123