| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Regular | How to redirect my visitors depending on where they come from (UK or USA) Hi, How do i make it so that when someone goes to: www.nintendoshop.net If they are from the UK, they get redirected to uk.nintendoshop.net and if they are from anywhere else in the world (such as the usa) they get redirected to nintendoshop.net Does anyone know how to do this? (The best/easiest way) Thanks. |
| |
| | #2 (permalink) |
| NamePros Regular | as far as i know, the only way to do it would be by tracing their ip, like sourceforge does when you download this might not be reliable, as ips can be spoofed. the other way is by asking the user then placing a cookie with their info on their pc.
__________________ _\|/_ _\|/_ _\|/_ _\|/_ _\|/_ :confused: |
| |
| | #5 (permalink) | |
| No Country for Old Domainers ... Member Services | There's many ways really - .... but none are foolproof. PHP Code: ![]() en-uk visitor (Only those with their "main locale" set on their browser to English/United Kingdom) would go to "uk.nintendoshop.net" - All others will go to "nintendoshop.net" .... (Whether they have a locale set or not). Just a different way to approach it ![]() Remember though ! Quote:
| |
| |
| | #6 (permalink) |
| Senior Member | If you don't need it to happen automatically, you can do what UPS and other places do. Go to ups.com to see what I mean. I can do that for you, just PM me.
__________________ Web Development |
| |
| | #7 (permalink) |
| NamePros Regular | You can use the Geo-IP Database (for a price). Their database is very comprehensive with many ISPs listed. LINK : http://www.maxmind.com/app/country |
| |
| | #8 (permalink) |
| NamePros Regular | Thanks for the help - im still not 100% sure what kind of redirect i want... so just a quick question: If i use a simple redirection code (like the php code in a few posts above me) where will a search engine bot go? Will the search engine bot also be redirected or...? |
| |
| | #9 (permalink) |
| Senior Member | Sometimes the search engine will follow. Sometimes it will say "screw this".
__________________ Web Development |
| |
| | #11 (permalink) | |
| NamePros Regular | Quote:
If you use the above PHP method, it will follow as a header that the site is moved will be sent. | |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |