GEO Redirect with Wordpress

mlektra

Banned
Jan 8, 2008
57
1
0
Canada
Hi guys. I am looking for a script that will send specific country visitors to another page in my wordpress blog. I want traffic from NZ, AU, UK, IT, FR to go to a specific page. I searched the forum fo a thread, but I think the scripts are not working on WP. If anybody has an idea?
 


man i swear there was a plugin created by a WF Member that does exactly this, but I cannot remember the name....
 
ip2nation - resolve IP to country - country-based redirect

this is exactly what you need, straight from the example page..

you simply query the database (as shown in the example - the same exact query should to the trick for you, too)

the you use a switch statement to redirect people based on country. you can add, as per the example, any country you want, just make sure you use the correct country code (ie, se is for Sweden, etc.); just take a look at the source code, you'll probably figure it out :)

to be honest, it's kinda self-explanatory.. if you can't copy/paste this code and do minor modifications to it, in order to suit your needs, then maybe you should learn some basic PHP programming (or hire someone, dunno)

anyway, put this code at the top of your page (edit index.php of your WP theme) and it should work.

post back if you encounter any problems.
 
oh, no thats ok for the code. I guess I put in on my page. But it's just how to upload the sql file to my server that I am not sure of.
 
aah..log into cpanel/directAdmin/whateva your host might use and go to phpmyadmin

in the top vertical menu, there are several tabs; click Import, then choose Import from file or something like this.

alternatively, go to the SQL tab in phpmyadmin menu and copy/paste what's in the sql file (open it with a text editor).