1

I've got a site that needs to have at least two almost identical versions for two different countries/languages, and visitors should access one or the other depending on their location, country or language (in fact, the best answer in my case would be redirect by country).

The webserver is Apache, and I've read something about the GeoIP Apache API, but I'm not sure how to apply it (some brief instructions would be much appreciated) to my Apache install, and from there how to redirect one version or the other depending on the visitor location (that as far as I know is guessed through visitor's IP).

I wonder if maybe the language of the browser could be of use here, and redirect to each versions depending on the language code (en_US, es_ES, etc).

Is there a solution to this (if possible, free, but commercial solutions would be considered as well)?

javipas
  • 1,292
  • 3
  • 23
  • 38
  • 1
    You seem confused as to how you want to redirect users: Pick one Country/Location or Language. For Country/Location: Have you looked at the examples on the mod_geoip page you linked to? If Language: Browsers already send an `Accepted-Language` header with the language codes. After you figure the above out, please feel free to ask specific questions about implementing these. To answer your question "Is there a good answer" - Yes, there is; but you have to ask a good question first. – Chris S Jan 25 '12 at 14:52

3 Answers3

5

Do what international shipping companies do and have a "select your country" thing on the front page. Use the browser field to determine the default language. Use geo_ip to determine the default country. Make the user confirm, make sure they can change it, and make sure you store it in a cookie so they don't have to do it again.

Jeff Ferland
  • 20,239
  • 2
  • 61
  • 85
1

The site you link has all the relevant information on configuring apache with mod_geoip (which you should install beforehand).

Redirection by browser language is also covered in the httpd.conf comments as well as in a bazillion google hits, like this, for instance.

All this should solve your problem. If not, state why. Cheers.

Alien Life Form
  • 2,279
  • 2
  • 21
  • 31
0

You could use a hosted solution as well (like the one I'm involved in: www.splitterhq.com) especially for marketing links and QR Codes.

Then you can remove the step where users have to select the country and link to specific subpages or social media profiles etc.

All the best

dotmlj
  • 1