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

ali.sharif’s picture

if you want redirect in your homepage to another path, you can use below code and add to index.php file

Header( "Location: www.example.com/france" );

also you can use variable instead of france

tsi’s picture

How this can be done with a variable, to redirect every user to his country's page or fall back to a default page ?
Thanks.

ali.sharif’s picture

Before 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

mrfelton’s picture

Status: Active » Closed (won't fix)

ip2locale 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.