I need to 301 redirect visitors to my dot ca website from countries A and B to my dot com website. (Please note that my dot ca website is deliberately not indexed by search engines - robots.txt blocks all bots).
I realize that I need to lookup each visitor's IP address to see what country they are from. I can do this using a few options from various software providers (ie: a local database lookup with a database that needs constant updating OR using a web service where the database is stored and updated by the softare provider). I'd prefer to use the web service option.
My question: Can either option be done from within my .htaccess file? This way, I can avoid having to edit every page on the site (100+) to add a snippet of PHP code to do the IP lookup and 301 accordingly.
I think what I'm asking is - can the contents of the .htaccess file be updated dynamically (since the IP addresses/ranges of the blocked countries are constantly changing)?