/    Sign up×
Community /Pin to ProfileBookmark

Re-direction based on country required

Hi Friends,
I have a php based site and I want to re-direct my users according to the country they are based in.For eg:
Usa users would be re-directed to :
[url]http://www.mysite.com/usa/index.php[/url]
while,Canada users would be re-directed to :
[url]http://www.mysite.com/canada/index.php[/url]

I saw some ready-made sripts available to do this….but can someone please suggest me which is the best way to do this?? Or which is the best and reliable script that lets you do this.

Any help would be appreciated.
Thanks
Mick

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@Doc_ThirstJul 31.2006 — How do you plan to learn what country they are from? Dropdown list?
Copy linkTweet thisAlerts:
@mickscoolauthorAug 01.2006 — Thanks Doc Thirst,

But thats what my question is!!!

Say, a user from usa types : http://www.mysite.com

So,I want that the the script should automatically re-direct this user to:

http://www.mysite.com/usa/index.php

And another user from canada too types : http://www.mysite.com

For this,the script should re-direct the user to:

http://www.mysite.com/canada/index.php

So,I want to know which is the best script that lets you do this??

-Mick
Copy linkTweet thisAlerts:
@balloonbuffoonAug 01.2006 — Well you can do it based on ip, but there are obstacles. First, you need a database of ip ranges and associated countries. You may not be able to find a good file for free. Second, the ip of the user may not actually be where they're located, for instance, if their isp is located in a different city (or country, I suppose.) So really, its more trouble than its worth. Just let them manually select which country they are from; I'm not aware of any better way.

--Steve
×

Success!

Help @mickscool spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...