Forum Moderators: open
For example, let's say IP addresses for Thailand always and only start with 202. and 203. I want to have a Javascript that says "Scan for IP address, if it begins with 202. or 203. redirect here, otherwise redirect there". But like I said before, I can't find any lists of which prefixes match which countries, so maybe my understanding of IP addresses is wrong.
If IP addresses are dynamically created and random, the only other choice I'd have is detecting the default language of the browser and then redirecting. The downside of this approach is people OUTSIDE Thailand would also be redirected, and those within Thailand with their default language other than Thai would NOT get redirected. I'd prefer to have the first option, detecting IP address and redirecting based on country location only. It's more reliable.
Could anyone advise, please?
There is no direct relationship between IP addresses and location that can be got from looking at the IP number - you need to do a lookup to determine this.
There are companies out there that specialise in this sort of service.
HTH