[PHP] m0nsta.'s .htaccess IP Banner

Results 1 to 11 of 11
  1. #1
    Web Developer Markshall is offline
    MemberRank
    Oct 2009 Join Date
    EnglandLocation
    628Posts

    [PHP] m0nsta.'s .htaccess IP Banner

    Just a simple project that generates a .htaccess file for you that denies access from certain IP Addresses that you specify to your website.

    Link:
    m0nsta.'s .htaccess IP Banner


  2. #2
    Account Upgraded | Title Enabled! Bonitão is offline
    MemberRank
    May 2009 Join Date
    795Posts

    Re: [PHP] m0nsta.'s .htaccess IP Banner

    maybe create a simple class to ban, unban, check if the ip is banned, etc.
    it's easy, just write to the file (if you can write to .htaccess files, not sure)

    hmm just thought that over, i don't think that would work out so good.
    Last edited by Bonitão; 26-03-11 at 06:41 PM.

  3. #3
    Web Developer Markshall is offline
    MemberRank
    Oct 2009 Join Date
    EnglandLocation
    628Posts

    Re: [PHP] m0nsta.'s .htaccess IP Banner

    All it does is generates a file for you. If you don't need a IP banning then you don't need to put it in, right?

  4. #4
    Banned Blasian is offline
    BannedRank
    Aug 2009 Join Date
    California, USLocation
    773Posts

    Re: [PHP] m0nsta.'s .htaccess IP Banner

    Bad way to ban.
    - Takes to long to open it.

    Better to do it threw the actual website dont you think?

  5. #5
    Account Upgraded | Title Enabled! Putako is offline
    MemberRank
    Mar 2011 Join Date
    CanadaLocation
    542Posts

    Re: [PHP] m0nsta.'s .htaccess IP Banner

    Ehh, This is okay.. Simple enough. Make it generate a file for it so they can just download it ;)

  6. #6
    Account Upgraded | Title Enabled! Hexadecimal is offline
    MemberRank
    Dec 2010 Join Date
    424Posts

    Re: [PHP] m0nsta.'s .htaccess IP Banner

    Quote Originally Posted by Dude3889 View Post
    Bad way to ban.
    - Takes to long to open it.

    Better to do it threw the actual website dont you think?
    Or a Firewall.

  7. #7
    The Omega Superfun is offline
    MemberRank
    Dec 2006 Join Date
    The NetherlandsLocation
    5,227Posts

    Re: [PHP] m0nsta.'s .htaccess IP Banner

    Most people just host their website at *some* company, so they dont have access to the physical iptables or w/e windows uses, ipsec i guess.

  8. #8
    Web Developer Markshall is offline
    MemberRank
    Oct 2009 Join Date
    EnglandLocation
    628Posts

    Re: [PHP] m0nsta.'s .htaccess IP Banner

    Yeah, yeah I understand
    I've only made this to see if it would work; it may come in handy for someone one day so I put it up.

  9. #9
    :-) s-p-n is offline
    DeveloperRank
    Jun 2007 Join Date
    Next DoorLocation
    2,098Posts

    Re: [PHP] m0nsta.'s .htaccess IP Banner

    Quote Originally Posted by http://mark-eriksson.com/php/htaccessipban/
    order allow,deny
    deny from Enter IP Address(es) here. Seperate with line breaks.
    deny from
    deny from For example:
    deny from

    deny from ip1.1.1.1
    deny from ip2.2.2.2
    deny from ip3.3.3.3
    allow from all
    It bans each line.. You should make it check to see if each "~IP~" is a valid address.

    It's dangerous to edit the .htaccess in places where the .htaccess file can disable it.

    nice experiment though

  10. #10
    Web Developer Markshall is offline
    MemberRank
    Oct 2009 Join Date
    EnglandLocation
    628Posts

    Re: [PHP] m0nsta.'s .htaccess IP Banner

    Quote Originally Posted by s-p-n View Post
    It bans each line.. You should make it check to see if each "~IP~" is a valid address.

    It's dangerous to edit the .htaccess in places where the .htaccess file can disable it.

    nice experiment though
    Yeah good idea.. I'll work on that.

  11. #11
    Developer Macbeth is offline
    MemberRank
    Dec 2007 Join Date
    SwedenLocation
    392Posts

    Re: [PHP] m0nsta.'s .htaccess IP Banner

    It's better to do it via a database I think. And then just search if the current users IP adress is one of the banned in the db.



Advertisement