Only allow selected IPs

Results 1 to 3 of 3
  1. #1
    YOLO <3 DutchenL is offline
    Grand MasterRank
    Jul 2013 Join Date
    543Posts

    Only allow selected IPs

    Hello,

    Is there a way to only allow for example German IP adresses? I know this is possible with CloudFlare but I don't use it anymore as I use now HyperFilter.

    Anyone an idea?


  2. #2
    Member Alex Be is offline
    MemberRank
    Nov 2013 Join Date
    AustraliaLocation
    68Posts

    Re: Only allow selected IPs

    Try using
    Code:
    <?PHP
    $country = geoip_country_name_by_name($_SERVER['REMOTE_ADDR']);
    $country = strtolower($country);
    if ($country != ("germany")){header("Location: http://myhotelurl/blocked"); exit();}
    ?>
    

    Hopefully that will work.
    Change "myHotelUrl" to your hotel url, and /blocked to what ever page you want to take them to.

    Last edited by Alex Be; 23-12-14 at 02:47 PM.

  3. #3
    G'nome sayin' Exonize is offline
    Grand MasterRank
    May 2011 Join Date
    Czech RepublicLocation
    517Posts

    Re: Only allow selected IPs




Advertisement