Has anyone installed CIDRAM (access management to block undesirable IP addresses) on Drupal 7.

It requires adding a "php require" statement to a file that is executed on every attempt to access the web site, and I do not know which file to use. Any advice gratefully received.


  • Use hook_init. Create a custom module. In your .module file use this hook.
    – No Sssweat
    May 20, 2019 at 11:14
  • hook_init() doesn't run on cached pages, but hook_boot() runs on all requests that get routed to Drupal.
    – mpdonadio
    May 20, 2019 at 14:46

2 Answers 2


I think that the ip_ranges module is a lot more used and easier to setup.

Try to install that module, should be quite easy to configure.

Good luck.


I have placed the line

require DRUPAL_ROOT . '/pah_to_file/loader.php';

in the index.php file at the top level of the drupal files.

It works well!!

Not the answer you're looking for? Browse other questions tagged or ask your own question.