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
bestempire is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 06-04-2009, 07:57 PM Re: Redirection based on user's IP address
willcode4beer's Avatar
Super Moderator

Posts: 1,390
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.
__________________
Paul Davis

earn $$$ write for willCode4Beer.com
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
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,390
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.
__________________
Paul Davis

earn $$$ write for willCode4Beer.com
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: 101
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.
__________________
AccuWebHosting.Com - Windows Hosting Expert
ASP.NET 3.5 | SQL 2005 Database | US Based Hosting Company | 24 X 7 Support | Daily Backups | Uptime Guarantee | Affiliates - $50 Per Sale
| Website Hosting
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.11494 seconds with 13 queries