Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Redirection based on user's IP address
Old 06-04-2009, 05:38 AM Redirection based on user's IP address
Average Talker

Posts: 28
Trades: 0
Hello,

I am looking for a way to setup a redirection of users to my websites using their IP address.

Those who are with Vietnam IP will be direct to www.domain.com/vn and the rest of the world will stay on www.domain.com

Have you got any idea how to set this up

Thanks
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
bestempire is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-04-2009, 07:57 PM Re: Redirection based on user's IP address
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
There are a million different way to do this. But, to help, we'd have to know a little more.
What server are you using?
What server technology is it using?
What do you know how to do?

You will probably want to set up a geolocation database (to map IP to country) or pay for a service.
__________________

Please login or register to view this content. Registration is FREE

willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 06-05-2009, 01:14 PM Re: Redirection based on user's IP address
Average Talker

Posts: 28
Trades: 0
Thanks Paul for your feedback.

I am using now Linux Apache server with PHP and MySql

I am not a real coders but can play around with some scripts.

Can you help by suggesting some sites or services?

Bestempire
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
bestempire is offline
Reply With Quote
View Public Profile
 
Old 06-05-2009, 05:07 PM Re: Redirection based on user's IP address
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
Start with this:
http://www.google.com/search?q=geoip+lookup

There's a group (I forget the name, just google around, you'll find it) that provides free data that you can drop into your MySql database.

Then you can use PHP to lookup a visitor's country code. If it's not allowed, just return a 302 to where you want them to go.
__________________

Please login or register to view this content. Registration is FREE

willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 06-12-2009, 11:39 AM Re: Redirection based on user's IP address
Super Talker

Posts: 100
Trades: 0
You keep the IP addresses of the vietnam in the database. And in the code of your home page, before serving the page, you check the browsers IP address with the IPs stored in the database. And then redirect to /vn/ if there IP address in found in the db.

You can easily buy the IP range from IPlocation.
__________________

Please login or register to view this content. Registration is FREE

ASP.NET 3.5 | SQL 2005 Database | US Based Hosting Company | 24 X 7 Support | Daily Backups | Uptime Guarantee | Affiliates - $50 Per Sale
|
Please login or register to view this content. Registration is FREE
twhdir is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Redirection based on user's IP address
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18126 seconds with 12 queries