Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Christine Barrett Posted July 19, 2019 Posted July 19, 2019 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.
Jim M Posted July 19, 2019 Posted July 19, 2019 Something like blocking IPs would be more beneficial on the server or network level. Have you contacted your hosting provider to see if they have a solution?
Christine Barrett Posted July 19, 2019 Author Posted July 19, 2019 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?
Jim M Posted July 19, 2019 Posted July 19, 2019 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.
bfarber Posted July 22, 2019 Posted July 22, 2019 While I fundamentally agree with Jim's recommendation, if you are forced to include a script in the manner you are describing, your best bet would be to use a require_once() call from either conf_global.php or constants.php.
Christine Barrett Posted July 22, 2019 Author Posted July 22, 2019 Thank you for your help. I will look into that option as well.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.