TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do you forward traffic based on country of origin?

2 点作者 takrupp超过 14 年前
We are a small, but successful e-commerce site and we have distributors now in 5 different regions. The regions are all country specific and it is very important for our relationships with our distributors that traffic in one country gets redirected to the right country website.<p>Basically, want we want is if a user is coming from Canada, they go to our .ca domain. If they are in the UK or Western Europe they go to a .co.uk domain, and all customers in Latin America go to .com.br domain. All other traffic needs to just go to the .com domain.<p>We are on a pretty locked down shopping cart system and we need to preserve our SEO standings for the .com domain.<p>What I'm looking for is perhaps a plugin or applet that when a user goes to the .com domain if they are in one of the other regions they are redirected or a pop appears that tells them which site to go to.<p>Anything boilerplate out there that will do this for us? Any other solutions? Also, if they search our brand name and are in Canada, will the .ca domain be automatically at the top? Or will the .com domain, which has tons of links and content on it, always supersede the weaker country specific domains?

2 条评论

byoung2超过 14 年前
Here is an interesting article on something similar: <a href="http://blog.unixy.net/2010/07/how-to-build-your-own-cdn-using-bind-geoip-nginx-and-varnish/" rel="nofollow">http://blog.unixy.net/2010/07/how-to-build-your-own-cdn-usin...</a><p>In this article, they actually have servers set up on the different continents, and users are served from a server nearest them. It wouldn't be too difficult to also serve them from the appropriate domain using redirects.<p>Keep the user experience in mind when you apply this, as there can be unintended side-effects. For example, as an American traveling abroad, I still like to see the US version of the site. It is very irritating when sites force me to the regional site based on IP address.<p>This happens with Google in particular. When I was in the Philippines a few months ago, it forced me to www.google.com.ph which is in Tagalog (you also see different results, likely based on what is popular in that country, and fewer search ads show because of targeting). GoDaddy as well detected I was in the Philippines, and forced my currency type to Philippine Pesos when I tried to buy a domain name, and only a call to support could fix it.<p>Make sure you give users a choice.
spooneybarger超过 14 年前
Many webservers have the ability to do GeoIP lookups from a database. I did a setup before that used a GeoIP database ( country level in your case ) from MaxMind which I used in conjunction with Nginx geo module ( <a href="http://wiki.nginx.org/NginxHttpGeoModule" rel="nofollow">http://wiki.nginx.org/NginxHttpGeoModule</a> ) to direct people from certain countries to different domains.<p>In the case of that setup, I needed a script that converted the MaxMind textual format over to a format that nginx could understand and then a bit of nginx code to do redirects based on the country that came up.<p>You need to be careful with something like that though. You want to make sure you aren't redirecting google's bot etc away from the site it is trying to get to.<p>In terms of your .com/.ca search question. They are going to get your .com. You could setup google campaigns that target users from specific countries so that your .ca appears above the organic listing...
评论 #1672353 未加载