根据国家的重定向? [英] Redirect depending on the Country?

查看:149
本文介绍了根据国家的重定向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们基本上有2个网站(的Java / JSP / Apache服务器):
something.ca&安培; something.com

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

该.CA是加拿大人的内容,而.com是美国的内容。

The .ca is canadian content, and the .com is american content.

我们需要用户根据IP addreess进行重定向。
我们希望美国用户获得.COM网站和加拿大用户得到.CA网站。

We need users to be redirected based on the ip addreess. We want US users to get the .com site and Canadian users get the .ca site.

什么是做到这一点(在网络服务器级别或其他方式)的最好方法?

What is the best way to do this (at a webserver level or otherwise ) ?

请详细说明。

推荐答案

我从使用的MaxMind的GeoIP和它工作得很好。他们有一个免费版本GeoCountry精简版这是99.3%准确。 的Java API是这里我将跟随有一个链接,谷歌的做法回原来的版本,如果你做重定向。

I've used GeoIP from Maxmind and it works well. They have a free version GeoCountry Lite That's 99.3% accurate. the Java API is here I would follow google's practice of having a link back to the original version if you do the redirect.

这篇关于根据国家的重定向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆