I am trying to redirect people on my site depending on their IP Address, and more specifically everyone who’s IP doesn’t match the one specified in the array, in my code.
Here is my code:
$allowed = array("184.108.40.206");
$ip = $REMOTE_ADDR;
header("Location: http://www.google.co.uk); /* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
The problem is it redirects everyone even the specified IP address.
Any tips how to make it work?