Welcome to the RaGEZONE - MMORPG development forums.

Bloking All Ips From Certain URL?

This is a discussion on Bloking All Ips From Certain URL? within the Gunz Online forums, part of the MMO and MMORPG Developments category; is there anyway of blocking all ips to a certain url, and only be able to have ips that i ...

Results 1 to 7 of 7
  1. #1
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Jul 2007
    Posts
    385
    Liked
    4

    Bloking All Ips From Certain URL?

    Click
    is there anyway of blocking all ips to a certain url, and only be able to have ips that i customly add to be able to acess a certain website, like adminpanel

    exameple

    www. g u nz.co m/adminpanel


    and only have certain users be able to visit the "/adminpanel" part?

    is it possible to do with windows firewall since im hosting the web of vps.

    im not sure how to add a url type thingy in the windows firewall.

    anyone have a clue.
    THANKS :D!
    Last edited by yurij13; 05-08-12 at 07:33 PM.

  2. #2
    Die()
    Rank
    Subscriber
    Join Date
    Sep 2011
    Location
    /home/SDev/
    Posts
    586
    Liked
    185

    Re: Bloking All Ips From Certain URL?

    Use a .htaccess file
    Code:
    order deny,allow 
    deny from all 
    allow from 127.0.0.1
    Change 127.0.0.1 to your ip or the ip you want to unblock place it in the directory to whitelist other ips just add another allow from line.

    +Rep & +Like if You found my Post Useful.


  3. #3
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Jul 2007
    Posts
    385
    Liked
    4

    Re: Bloking All Ips From Certain URL?

    Quote Originally Posted by Secured View Post
    Use a .htaccess file
    Code:
    order deny,allow 
    deny from all 
    allow from 127.0.0.1
    Change 127.0.0.1 to your ip or the ip you want to unblock place it in the directory to whitelist other ips just add another allow from line.
    how would i allow more then 1 ip?

    like this?
    allow from 127.0.0.1,127.0.0.1,127.0.0.1 etc....


    or like
    allow from 127.0.0.1
    127.0.0.1
    127.0.0.1


    EDIT: this doesn't work at all... ='/
    Last edited by yurij13; 05-08-12 at 07:50 PM.

  4. #4
    Pee Aitch Pee
    Rank
    Subscriber
    Join Date
    Mar 2011
    Location
    The Netherlands
    Posts
    575
    Liked
    285

    Re: Bloking All Ips From Certain URL?

    No, like this:
    Code:
    allow from 127.0.0.1
    allow from 127.0.0.5
    allow from 127.125.234.1
    Secured and ammw like this.

  5. #5
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Jul 2007
    Posts
    385
    Liked
    4

    Re: Bloking All Ips From Certain URL?

    Quote Originally Posted by SuperWaffle View Post
    No, like this:
    Code:
    allow from 127.0.0.1
    allow from 127.0.0.5
    allow from 127.125.234.1
    thanks.
    but this doesn't work at all anyways =/.


    still lets me on when i blocked all ips from vps. =/

  6. #6
    Pee Aitch Pee
    Rank
    Subscriber
    Join Date
    Mar 2011
    Location
    The Netherlands
    Posts
    575
    Liked
    285

    Re: Bloking All Ips From Certain URL?

    Are you using Cloudflare? It doesn't work with Cloudflare.

    Add the following PHP code to your config file of the adminpanel.
    PHP Code:
    <?php
    $_SERVER
    ['REMOTE_ADDR'] = (isset($_SERVER['HTTP_CF_CONNECTING_IP']) && $_SERVER['HTTP_CF_CONNECTING_IP'] != "" $_SERVER['HTTP_CF_CONNECTING_IP'] : $_SERVER['REMOTE_ADDR']);
    $allowedips = array("127.0.0.1""127.0.0.5");
    if(!
    in_array($_SERVER['REMOTE_ADDR'], $allowedips))
    {
      die(
    "Access restricted");
    }
    ?>
    And add the allowed IP's to the array.
    yurij13 and ammw like this.

  7. #7
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Jul 2007
    Posts
    385
    Liked
    4

    Re: Bloking All Ips From Certain URL?

    Quote Originally Posted by SuperWaffle View Post
    Are you using Cloudflare? It doesn't work with Cloudflare.

    Add the following PHP code to your config file of the adminpanel.
    PHP Code:
    <?php
    $_SERVER
    ['REMOTE_ADDR'] = (isset($_SERVER['HTTP_CF_CONNECTING_IP']) && $_SERVER['HTTP_CF_CONNECTING_IP'] != "" $_SERVER['HTTP_CF_CONNECTING_IP'] : $_SERVER['REMOTE_ADDR']);
    $allowedips = array("127.0.0.1""127.0.0.5");
    if(!
    in_array($_SERVER['REMOTE_ADDR'], $allowedips))
    {
      die(
    "Access restricted");
    }
    ?>
    And add the allowed IP's to the array.


    alright thanks! worked ;)!

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •