

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

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?
======
byoung2
Here is an interesting article on something similar:
[http://blog.unixy.net/2010/07/how-to-build-your-own-cdn-
usin...](http://blog.unixy.net/2010/07/how-to-build-your-own-cdn-using-bind-
geoip-nginx-and-varnish/)

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.

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.

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.

Make sure you give users a choice.

------
spooneybarger
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 (
<http://wiki.nginx.org/NginxHttpGeoModule> ) to direct people from certain
countries to different domains.

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.

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.

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...

~~~
takrupp
Thanks, this is interesting. What I think would be the best solution would be
a pop-up (either in the front page or an actual popup) that if a user is from
a certain country's IP address it just says: Are you in Canada and looking to
buy our products? Please go to XXXXX.ca to place your order.

Is there a boilerplate app like that out there that we can just embed in the
front page? Also, our products are physical products, not software, so if you
are in Canada and even if you are American, you will need to place your order
through the .ca domain.

