How can i IP to locale for my PHP multilingual website?

56 views
Skip to first unread message

Mrugesh Panchal

unread,
Feb 25, 2010, 1:19:43 AM2/25/10
to PHP :: Be a part of it
Dear All,

I have developed multilingual website in Drupal (PHP). I want
to redirect the user on the version based on the from which IP he is
opening website. E.g. for example if site is opened from Netherlands
than it would be open by default in Dutch language.

And one another issue is that If user is accessing the website from
the same country but the country which having two languages. So, what
I have to do? Can any one suggest me?

Thank you,
Panchal Mrugesh.

mahavir

unread,
Feb 25, 2010, 1:50:06 AM2/25/10
to PHP :: Be a part of it
Hello Mrugesh.

we have some solutions about this issue.
we find out the country based ip range and set to the .htaccess file
and put the redirection ex
if range is 0-0 redirect to http://yoursite/en (language code)


or if u find in drupal way then use module from http://drupal.org/project/ip2locale.

also refer this website for the country codes : http://drupal.org/project/country_code

On Feb 25, 11:19 am, Mrugesh Panchal <panchal.mrug...@gmail.com>
wrote:

Mrugesh Panchal

unread,
Feb 25, 2010, 4:57:10 AM2/25/10
to PHP :: Be a part of it
Dear Mahavir,

Your I think .htaccess solutions is not feasible.

As you have suggested ip2locale module in Drupal.
It is good and helps a lot. It is redirecting to the country based
language.
It also uses the ip2cc module for finding the ip range to country
finding.

Please can you do more clarification on .htaccess solution.

Thank you,
Panchal Mrugesh.

On Feb 25, 11:50 am, mahavir <jspmaha...@gmail.com> wrote:
> Hello Mrugesh.
>
> we have some solutions about this issue.
> we find out the country based ip range and set to the .htaccess file
> and put the redirection ex

> if range is 0-0 redirect tohttp://yoursite/en(language code)
>
> or if u find in drupal way then use module fromhttp://drupal.org/project/ip2locale.

Reply all
Reply to author
Forward
0 new messages