Hi Mike, have now had a reply from the hosts :
Sorry, due to shared server environment, its not possible to enable Apache GEOIP module for you, as we need to compile the apache and it will cause an issue to other clients on server. Please upgrade your plan to a VPS or a Semi-Dedicated/Dedicated server, so that we can enable the same for you.
Where to next ?
If I can't be a good example, I'll just have to be a terrible warning...
Check website whois and PR on TheSiteCheck.com
Thanks, will bear that in mind. Mike - what do you advise next please?
Hi Mike, what do you suggest next please?
The helps appreciated.
After some more persuading, have just had another email from the support, to say : As per your request we have installed GeoIP on the server.
Is this good news? I assume so? What's next please?
The helps really appreciated.
Otherwise If you can't get the .htaccess file to work, you could either use a mysql database to store the IP's or even a text file, but a text file would be totally inefficient. There are plenty of GEO IP location / detection scripts to choose from if you do a quick google search.
The script I'm building will use an online GEO IP API lookup if no other IP database exists locally on the server. Most GEO IP API services have limits on the amount of lookups you can do each day, depending on which site is used.. some have limits such as 10,000 IP lookups per day, and on a high traffic site with lots of pages this would probably not last very long and the results would need to be cached too. My script is definitely not ready for a site with as many pages as you have Chris.
Actually it looks like using CloudFlare to try and block countries or redirect countries is not a very good idea and will not work as expected. You'll have to stick with the other methods of blocking / redirecting countries already discussed here.
CloudFlare Threat control PanelMy Block List
If an individual website owner adds an IP address or a range of IP addresses to the their "My Block List", the visitor will be banned from entering the site. When a user is banned, no CAPTCHA option is presented so there is no way for the visitor to access your site. The Block List is appropriate to use when you know, with a high level of certainty, that you do not want the IP address to visit your site. You can easily add or remove IPs to your block list.
You can also choose to add a country to your block list.
When you add a country to your block list, all visitors originating from that country are challenged, not banned.
Since they are challenged, visitors are given the option to pass a CAPTCHA to get on to your site. Challenged visitors also have the ability to write a short note to the web site owner, which you can see from your Dashboard.
The reason why CloudFlare does not ban an entire country is so that good users, residing in a country that tends to generate malicious activity, are still able to access tools they need online.
So if you really want a whole country to be 'blocked' you'll have to do it yourself.
Thanks Mike, but how do I allow certain countries, but redirect all others please?