Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 09-16-2009, 04:05 PM   #1
Warrior Member
 
Join Date: May 2008
Location: , , Romania.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default How do I create PHP GeoIP redirect ?

I have a niche autotoblog that drives me about 100 italian visitors daily. My conversion rate is 1:200. I am not glad with that.

What I need to do is redirect all my italian visitors to a nice landing page I created and keep all other visitors and spiders on my autoblog.

I just need a simple php script. Italian IPs are redirected to another page while all other visitors must remain on the page where they arrive (must not be redirected in any way because my visitors come from my wordpress posts that are indexed by google and I dont wanna mess with the GoogleBot)

Your help would be deeply appreciated.
invest207 is offline   Reply With Quote
Old 09-16-2009, 06:28 PM   #2
HyperActive Warrior
War Room Member
 
Join Date: Aug 2009
Posts: 107
Thanks: 3
Thanked 18 Times in 11 Posts
Default Re: How do I create PHP GeoIP redirect ?

Hey there invest207. There are a few options here. Not sure how much programming you do but you can do this pretty easily by making a call to a geolocation webservice. There are a few API's out there that are free.

Check these links out, they offer code examples as well:

roshanbh(dot)com(dot)np/2008/07/getting-country-city-name-from-ip-address-in-php.html

www(dot)ipinfodb(dot)com/ip_location_api.php

freegeoip(dot)appspot(dot)com/

www(dot)hostip(dot)info/use.html

Replace the (dot) with an actual .

Im not allowed to post links yet.
723Media is offline   Reply With Quote
Old 09-16-2009, 07:44 PM   #3
Personal hygiene coach
 
mojojuju's Avatar
 
Join Date: Aug 2005
Location: Potemkin Village
Posts: 1,083
Thanks: 268
Thanked 377 Times in 254 Posts
Social Networking View Member's Twitter Profile 
Default Re: How do I create PHP GeoIP redirect ?

You don't need to look any further than the Warrior Forum: How can I redirect traffic based on the visitor's country?

But, if you have your own server, you might find it best to install the mod_geoip module for Apache because it's a lot faster than the PHP module. Also, with the Apace module, you can do .htaccess based redirects.
mojojuju is offline   Reply With Quote
Old 05-23-2010, 08:49 AM   #4
On the grind...
War Room Member
 
Join Date: May 2010
Posts: 31
Thanks: 4
Thanked 6 Times in 6 Posts
Lightbulb Re: How do I create PHP GeoIP redirect ?

Hey,

Sorry to bring up a really old thread but did a search and thought it would be better than starting a new. Anyhow...

I currently have a wordpress squeeze page; I would like to know if it is possible to redirect visitors based upon country but keep the main page in other words not have to make index2.php etc etc. Would it mean me having to produce say 5 wordpress pages just to have them redirect? and would this effect my SEO ranking at all becuase all pages would effectivly be dupes. So you would have usa.salespage.com , uk.salespage.com and so fourth.

Does anyone have any ideas at all on this?
bl4ck-dollar is offline   Reply With Quote
Old 05-23-2010, 01:58 PM   #5
Advanced Warrior
War Room Member
 
Join Date: Nov 2009
Posts: 41
Thanks: 0
Thanked 6 Times in 5 Posts
Default Re: How do I create PHP GeoIP redirect ?

Quote:
Originally Posted by bl4ck-dollar View Post
Hey,

Sorry to bring up a really old thread but did a search and thought it would be better than starting a new. Anyhow...

I currently have a wordpress squeeze page; I would like to know if it is possible to redirect visitors based upon country but keep the main page in other words not have to make index2.php etc etc. Would it mean me having to produce say 5 wordpress pages just to have them redirect? and would this effect my SEO ranking at all becuase all pages would effectivly be dupes. So you would have usa.salespage.com , uk.salespage.com and so fourth.

Does anyone have any ideas at all on this?
If all pages are the same, why do you even want to create duplicates?

If the content & offers on each of those pages are going to be different, then it makes sense. You will need a geo-database API or the actual geo DB for this.
Guide is offline   Reply With Quote
Old 05-23-2010, 02:24 PM   #6
On the grind...
War Room Member
 
Join Date: May 2010
Posts: 31
Thanks: 4
Thanked 6 Times in 6 Posts
Default Re: How do I create PHP GeoIP redirect ?

Do you know where I can get one from? And also will my main site stay the same or will I need some index.php for the redirect?
bl4ck-dollar is offline   Reply With Quote
Old 05-25-2010, 04:52 AM   #7
Banned
 
Join Date: May 2010
Location: Up to me
Posts: 148
Thanks: 3
Thanked 14 Times in 13 Posts
Contact Info
Send a message via Skype™ to kiopa
Default Re: How do I create PHP GeoIP redirect ?

Quote:
Originally Posted by bl4ck-dollar View Post
Do you know where I can get one from? And also will my main site stay the same or will I need some index.php for the redirect?
Sure, you can get a free GeoIP database from here:

www . maxmind . com / app / geolitecity

Commercial database is $370, but the lite version seems to work quite well, although not 100%. API and code is also very simple to work with. I'd recommend it!
kiopa is offline   Reply With Quote
Old 05-25-2010, 05:45 AM   #8
On the grind...
War Room Member
 
Join Date: May 2010
Posts: 31
Thanks: 4
Thanked 6 Times in 6 Posts
Default Re: How do I create PHP GeoIP redirect ?

Thank you for your reply! I have downloaded and made up a PHP file and all works well!

Just one quick question which I find doesn't really work with me; Say if a user goes to the main domain and he/she is in the UK and gets directed to websitename.com/uk thats all good and works well but what if they click on a link for the usa? websitename.com/usa doesn't seem to forward them to the correct country.

Is there some kind of fix for this?
bl4ck-dollar is offline   Reply With Quote
Old 05-25-2010, 05:55 AM   #9
Banned
 
Join Date: May 2010
Location: Up to me
Posts: 148
Thanks: 3
Thanked 14 Times in 13 Posts
Contact Info
Send a message via Skype™ to kiopa
Default Re: How do I create PHP GeoIP redirect ?

Best way I can suggest is add a cookie when they click the link, which overrides the IP lookup check.
kiopa is offline   Reply With Quote
Old 09-16-2010, 08:19 AM   #10
Warrior Member
 
Join Date: Jan 2007
Location: , , United Kingdom.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: How do I create PHP GeoIP redirect ?

Hi

This site may help. GEO IP Targeting Script - Geo IP Country Detection Redirect Script it has 2 GEO targeting scripts

One script to display affiliate ad code based on site visitors County IP and another script to GEO IP country redirect to another page.

All The Latest Resources & FREE STUFF for Affiliate & Niche Marketing at http://www.NICHExtra.com/

.
fbnet is offline   Reply With Quote
Old 09-28-2010, 12:08 AM   #11
Warrior Member
 
Join Date: Sep 2010
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: How do I create PHP GeoIP redirect ?

I am also looking for the same. I was told that I should get the form first. There is an online firm that helps in creating.

kevinfurtadoos5 is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
create, geoip, php, redirect

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 04:45 AM.