How-to Redirect Foreign Traffic?

Questions about hostip.info remote GET support.

Moderator: Moderators

How-to Redirect Foreign Traffic?

Postby agentmilo on Thu Aug 14, 2008 11:28 am

I want to know how to use "http://api.hostip.info/country.php" to set a value for the country code and if that value is not equal to "US" I want to redirect them to another website. Can anyone help me with this please?
agentmilo
n00b
 
Posts: 1
Joined: Thu Aug 14, 2008 11:25 am

Re: How-to Redirect Foreign Traffic?

Postby bbugmenot on Fri Oct 24, 2008 9:08 am

If you use PHP and have allow_url_fopen enabled, then you can read this URL as if it was a regular file and issue header() based on that.

However be careful with this, because IP2country information isn't 100% reliable and you may block some US visitors.
bbugmenot
n00b
 
Posts: 6
Joined: Wed Nov 28, 2007 6:05 am


Return to Hostip.info remote GET/PHP support

Who is online

Users browsing this forum: No registered users and 1 guest

cron