Please tell me is if this code string is right

123 views
Skip to first unread message

Nguyen Tuan

unread,
Sep 13, 2018, 1:00:39 PM9/13/18
to geoPlugin
Dear all Pros
I would like my landing page to redirect to website www.A.com for tier 1 countries and website www.B.com for all other countries, so the codes were written like this:

<?php
$countrycode= $a['geoplugin_countryCode'];
if (in_array($countrycode, array('us','gb','at','de','ca','ch','fr','it','nl','au','nz','sg','ch')))
    header( 'Location: http://www.A.com' ) ;
else 
    header( 'Location: http://www.B.com' ) ;

?>

But while checking I see that it could not redirect to website www.A.com when visitors from the tier 1 countries visit the landing page. Only the website B was redirect to.

Please help me, tell me what is wrong and how to fix it. Thank you a lot all pros!

morten.go...@gmail.com

unread,
Oct 12, 2018, 12:19:51 PM10/12/18
to geoPlugin
countrycode is uppercase.
Reply all
Reply to author
Forward
0 new messages