Geoip Redirecting

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
davis1
Forum Newbie
Posts: 2
Joined: Sun Feb 12, 2012 2:55 pm

Geoip Redirecting

Post by davis1 »

I have a site with pages translated in several languages.
Does anyone know how could i make my site to open in best fitting language for visitors based on their ip?

Regards,
Daniel
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Geoip Redirecting

Post by social_experiment »

A better option would be to have a visitor choose their language preference;

If you have your heart set on this idea then you should look for ip ranges from certain countries and based on those values use a header() to redirect the visitor to the appropriate language page.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply