How to sniff the IP address?

Hello Forum!

I apologize if this has already been asked and answered here.

How do I code my web site so that I can sniff out the IP address of the person visiting the site? I want to then redirect the user according to their IP address. Specifically, if the user is coming from an Arabic or Farsi country state, I want to redirect them to a different page (then if they specifically request to see the content in English, I will remember this by a cookie).

I have used “maxmind geoip” in the past. It’s reasonably accurate.

you could also check the Accept-Language header to find out users interested in arabic/farsi content.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.