Jump to content

How to include a script to block countries by IP


Recommended Posts

I am trying to install a country ip blocking script to our forum to prevent access to countries like Cuba, Iran, North Korea, etc.

I have tried including the php script with (include, require, require_once) but I cannot get it working on forum.altair.com without it throwing a 500 Internal Server Errors. It was attempting to load the file more than once despite that it was only being called out once. 

What would be the best practices for including php files that load first?

Thank you for your help.

Link to comment
Share on other sites

43 minutes ago, Christine Barrett said:

Well we are trying to block countries like Iran, North Korea, Cuba using an IP lookup service. So we are not blocking a known IP. How would the server do that without loading files in the www root?

Various firewalls may have rules that you could take advantage of. CSF does allow you to block countries. Your hosting provider may have a better solution which is why I suggested getting in contact.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...