I'm new to Joomla, I have been asked to make a joomla site (2.5) redirect to a particular language based on the visitors IP. I'm not sure how well you can determine an appropriate language by IP range but that what has been asked. If the user has an IP associated with Saudi Arabia, for example, they should be redirected to http://www.mysite.com/ar/
The default should be english, so if the system can't come up with a suitable language it will just show http://www.mysite.com/en/
What is the best way to implement this?
I have managed to change the language by placing the following code in the index.php:
Code: Select all
$tag = 'hy-AM';
$extension = "";
$base_dir = JPATH_SITE;
$language =& JFactory::getLanguage();
$language->load($extension, $base_dir, $tag, true);
Thanks for any advice