Answer the question
In order to leave comments, you need to log in
How to redirect to another page using a list of IP addresses?
Do you need to redirect from the main page of the site to another if the user entered from an IP address that is not in the specified range?
For example, how do some services like spotify.com do it? The meaning of the redirect is the same, to allow users to visit the site only from a certain country.
What is the best way to do this? Do it on the client or server?
Answer the question
In order to leave comments, you need to log in
geoip is called such functionality
dev.maxmind.com/geoip
It is better to do a redirect on the server.
$_SERVER["REMOTE_ADDR"] - ip address
check if it is included in the array if it is included we give one link if we do not enter the second
one so you can find out the user's country and redirect to the page you need
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question