I have two sites, example.com and example.org and I want to redirect all the people visiting from a Country X visiting example.org to example.com, how to do it using php or .htaccess ?
in short, both sites will work but for a Country X ip’s, the visitors browsing .org will redirect to .com without them knowing
You need a GEO IP lookup tool, like
http://www.hostip.info/use.html
You can use their service in php – your index.php would like something like this:
Alternatively, a much faster method is to purchase the ip database list from max mind (it’s $50). http://www.maxmind.com/app/country
Then you simply query that database (after loading it into mysql) and bump them based on country.