Answer the question
In order to leave comments, you need to log in
Redirecting certain IP addresses to different sites?
Good day to all. Faced such a problem.
There is a main domain:
http://site.ru
and there are 4 subdomains in this domain.
There is a list of IP addresses with subnets.
It is necessary to make a redirect to subdomains for certain IPs. Example:
10.76.0.0/14
10.80.0.0/14
go automatically to subdomain 1.sayt.ru
10.64.0.0/14
10.240.0.0/17
go to subdomain 2.sayt.ru
And so on.
Any suggestions on this issue?
Answer the question
In order to leave comments, you need to log in
I found the following solution:
if ($_SERVER['REMOTE_ADDR'] == "1.1.1.1") {
header("Location: ya.ru ");
}
Everything works great. But if you make a subnet for example 1.1.1.1/24 - it doesn't work :(
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question