Via the htaccess file, trying to allow access to a few countries, and redirect all other countries to a certain page on the same website page, but can this really be done?? Aren’t they being redirected in the first place?? Bit confused!
You need to have mod_geoip set up on the server which you can get from: MaxMind - GeoIP Apache API
You also need a geolocation database which you can get from the same site.
Once thats set up and configured the rewrite rule in your htaccess file is something like:
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} US [NC]
RewriteRule ^$ index-us.html [L]
The site linked above seems to have some good examples but hopefully this will get you started.
Thanks for that Dan, it’s appreciated. Just having a hard time trying to understand. I want it, so that all countries not on the allowed list, will be redirected to another page on the same site, but my logic is asking whether there would be a loop?