Redirection by country?

We mainly have 2 sites (Java / JSP / Apache Webserver): something.ca and something.com

.ca is Canadian content and .com is American content.

We need users to be redirected based on ip addreess. We want US users to get a .com website, and Canadian users to get a .ca website.

What is the best way to do this (at the web server level or otherwise)?

Please clarify.

+3
source share
5 answers

In my surfing experience, most websites — for example, UPS.com — will ask the user to select their country’s website, rather than trying to figure it out themselves. They remember the choice in the cookie. Much depends on how voluntary your use case is.

, , , .

+3

GeoIP Maxmind, . GeoCountry Lite. 99.3%. Java API Google , .

+3

GeoDirection. , javascript.

http://www.geobytes.com/GeoDirection.htm

- . , , , , . , , - , - .

+2

IP- IP- - , - , :

+1

Using culture settings is an option, but in some cases it does not work. What if you have a German user in the USA who likes his dates, etc., displayed in a format convenient for him? It does not change the fact that he is in the USA.

I think that one of the reasons why most companies simply ask the user and then store this information in a cookie (UPS, FedEx and most major airlines). Go to www.lufthansa.com. They are actually asking for location and language (to account for countries with more than one official language, such as Switzerland).

+1
source

Source: https://habr.com/ru/post/1698651/


All Articles