Sorry MMM, sorry Bald and Rick if I'm introducing in this discussion but... a "straight redirect" of users from an "expected location" to another looks a little bit tricky for me and for search engines. Search engines are becoming very susceptible to those redirects and I heard a lot of stuffs about "sneaky redirects".
So... why not just "block" the click on the source (on page) with a "warning", a "disabled button/text" or something similar?
I mean: a US visitor comes on MMM's Royal Panda review page and he/she just see "You're not allowed to play/register at this Casino" (or similar).
So, I would go with a simple function like:
HTML Code:
<?php
$country = $_SERVER["HTTP_CF_IPCOUNTRY"];
function check_country($code) {
if($code=='US') {
$text = '<a href="http://yourtrackinghere.com&affid=your" class="disabled">You're not allowed to play here</a>';
} else {
$text = '<a href="http://yourtrackinghere.com&affid=your">Play at CasinoName</a>';
}
}
return $text;
}
;?>
Then, where you want to appear text:
HTML Code:
<?php echo check_country($country);?>
In your CSS you can disable the click event:
HTML Code:
.disabled {
pointer-events: none; <----- you can click but nothing happens or you can set up a pop-up etc...
}
...or you can set-up a pop-up when a US visitor reach those pages. Or what you want.
You can do it also automatically; I see on the review page a list of restricted countries. If this list is rendered through an array, you could loop through this array then show a "custom text" for each country. I don't know... just to say