How do you ban an ip address?

Discussion in 'Web Design and Development' started by Chef55, Oct 27, 2008.

  1. Chef55 macrumors member

    Sep 10, 2008
    Am having trouble with someone leaving messages on my guestbook so want to ban their ip address so they can't access my site. I don't use an imac account. Help please anyone?
  2. belvdr macrumors 603

    Aug 15, 2005
    No longer logging into MR
    Can you explain your config some more? Is this an app hosted on your system at home? Do you have a firewall?

    That said, if this person has a dynamic IP, this will likely only deter them for a period of time.
  3. angelwatt Moderator emeritus


    Aug 16, 2005
    If you're using an Apache web server, add this to a .htaccess file:
    <Limit GET POST>
       order allow,deny
       allow from all
       deny from
    That .htaccess file should be saved to your htdocs (or equivalent folder i.e. htmlpublic) folder.

    Like belvdr mentioned though, people generally have a dynamic IP so it's not a full-proof solution. You can also use PHP/MySQL to keep a list of IP to block. There should be scripts out there for setting this up. You might be able to set other solutions up too depending how consistent this user is.

Share This Page