in order to implement something like that yourself..
you can make use of a geolocation service.. which cost money (google geolocation)
write a little php script which gets the IP from the request and matches it to the right location, then sends an html redirect header.
or probably a bit of a kludge but, when I tracert my IP address, it's last hop (me) is xxx-xxx-xxx-xxx.dyn.isp.com.au
again, with a script, you could tracert the users IP, and then with regex or some other sort of text matching doodad, extract the country code of the last hop (in my case .au)
and then redirect to the appropriate location.
that said, today is the first I have looked at geolocation, there is likely a much better way to do this.