Closed (won't fix)
Project:
IP to Locale
Version:
6.x-1.0-beta1
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2010 at 13:08 UTC
Updated:
2 Apr 2011 at 17:44 UTC
Hi,
Is it possible to redirect to a specified URL instead of a language domain? For example I want to redirect a user from France to a page wit url www.example.com/france. Can it be done with the help of rules module??
Thanks...
Comments
Comment #1
ali.sharif commentedif you want redirect in your homepage to another path, you can use below code and add to index.php file
also you can use variable instead of france
Comment #2
tsi commentedHow this can be done with a variable, to redirect every user to his country's page or fall back to a default page ?
Thanks.
Comment #3
ali.sharif commentedBefore redirecting you must check the user's ip and country.
For that you can check the ip address by <?PHP $_SERVER['REMOTE_ADDR']; ?> in PHP.
And for checking country you can use the ip2location.com api ...
Also you can use http://www.phpclasses.org/browse/package/2363.html
Comment #4
mrfelton commentedip2locale is for redirecting to site locales based on user location. So, you can accomplish what you want by setting up additional locales for your country specific pages, and 'translating' the pages. Then, ip2locale will redirect to the correct version of the pages for you.
If you want to do this without using site locales, then I think you'l need to look elsewhere.