htaccess the only way that I'm aware of on a "hosted" website.
If you have your own server, http.conf is more appropiate.
My widegts are exclusive to North America and I have most every non-NA range denied, however that was accomplished gradually and the providing the ranges to another would not be possible.
There are some websites, which you may go to an download entire ranges for specific countries, however these numbers change frequently. Even with the files downloaded, your still faced with the tedious process of converting the IP ranges to rewrites.
Note that many of those same "IP range sites" also offer paid services. These services track the ever-changing map of IP addresses to countries, and provide you with updated data.
Many provide two kinds of service; One where your server makes a call to their server to check a requesting IP address, and another where you periodically download updates from their database to your server, and all checking occurs locally on your server (which is *much* faster). Do a search for "GeoIP" to turn up more info.