Facebook
From Pantheon, 1 Month ago, written in PHP.
Embed
Download Paste or View Raw
Hits: 137
  1. <?php
  2.  
  3. /*
  4.  * For Drupal, insert this into settings.php, just after the opening <?php
  5.  *
  6.  * For WordPress, insert this into wp-config.php, just after the opening <?php
  7.  *
  8.  */
  9.  
  10. # Put Cloudflare IP Addresses Here
  11. $deny = array("111.111.111", "222.222.222","333.333.333");
  12.  
  13.  
  14. if (!in_array($_SERVER['REMOTE_ADDR'], $deny)) {
  15.    header("location: https://example.com/");
  16.    exit();
  17. }
  18.  
  19. ?>