In PHP I have a line of code similar to:
[code=php]$ip = $REMOTE_ADDR ;
if ($ip == “137.229.183.43”)
{
header(“Location:http://www.site-a.com”);
}
else
{
header(“Location:http://www.site-b.com”);
}
This code works great for me. It allows me to have a certain IP address be redirect to one site, while other IP addresses get directed elsewhere.
My question is, how would I work it so that instead of targeting one address, I would target a range? Such as:
137.229.183.30 – 137.229.183.240
Also, using the same if statement line, how could I target multiple ranges? Such as:
137.229.183.30 – 137.229.183.240 & 31.41.59.26 – 31.41.59.250
Thank you very much for any help. ?