Banning someone's IP Address from my Site

Discussion in 'HTML & Website Design' started by Vexious, Oct 2, 2006.

  1. #1
    Some ass is mass-downloading all my content over and over and over and i finally realized it after he has eat 500gb of my bandwidth. I have read online and have got it to ban him, but i want a custom error message to come up.

    The code i have so far:

    <Limit GET>
    order allow,deny
    allow from all
    deny from 123.456.789.0
    deny from 123.4.5.
    </Limit>
    PHP:
    I have then tried adding...

    ErrorDocument 403 /403.htm to load a custom error page for people whoa re banned but it not working..
     
    Vexious, Oct 2, 2006 IP
  2. knightyme

    knightyme Peon

    Messages:
    59
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Bear in mind that I haven't had the need to ban anyone since selling my last membership site, however, if I recall correctly, this is what worked for me....

    ###start Ban
    order allow,deny
    deny from 127.0.0.0
    allow from all
    ###end Ban
    ###start custom redirect for errors
    ErrorDocument 403 /403.html
    ###end custom redirect for errors

    Of course, you'll have to create a custom 403.html page and install it in the same directory but it should do the trick.
     
    knightyme, Oct 2, 2006 IP
  3. Vexious

    Vexious Peon

    Messages:
    134
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    When testing with my own ip im getting:

    Forbidden
    You don't have permission to access / on this server.

    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
     
    Vexious, Oct 2, 2006 IP
  4. sawz

    sawz Prominent Member

    Messages:
    8,225
    Likes Received:
    808
    Best Answers:
    0
    Trophy Points:
    360
    #4
    sawz, Oct 2, 2006 IP
    Vexious likes this.
  5. Vexious

    Vexious Peon

    Messages:
    134
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Still getting

    Forbidden
    You don't have permission to access /404.php on this server.

    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

    Maybe i need to add an Allow all to the file 404.php?, 403.php? Maybe it banning the person from even reading that
     
    Vexious, Oct 2, 2006 IP
  6. sawz

    sawz Prominent Member

    Messages:
    8,225
    Likes Received:
    808
    Best Answers:
    0
    Trophy Points:
    360
    #6
    did you add this:

    
    ErrorDocument 404 /404.php
    Code (markup):
    to your .htaccess?
     
    sawz, Oct 2, 2006 IP
  7. knightyme

    knightyme Peon

    Messages:
    59
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hmmmm....that'll teach me not to play with it on my server before responding. Let me see if I can figure out what's wrong with mine.

    Sorry about that. :eek:
     
    knightyme, Oct 2, 2006 IP
  8. Vexious

    Vexious Peon

    Messages:
    134
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Yes...


    I found the problem... If you ban someone they cant even access the error file... however you can make it so it loads the 404.php in a different server or you can do:

    order allow,deny
    allow from all
    deny from 1.1.1.1
    <Files banned.php>
    allow from 1.1.1.1
    </Files>

    ErrorDocument 403 /banned.php

    =D

    time to go study for my Exam.. Thanks guys... BTW Rep point for you! I like the PHP error one as it notifies me via email when people access my error page! =D
     
    Vexious, Oct 2, 2006 IP
  9. sawz

    sawz Prominent Member

    Messages:
    8,225
    Likes Received:
    808
    Best Answers:
    0
    Trophy Points:
    360
    #9
    thank you, still haven't figured out the rep points.:eek:
     
    sawz, Oct 2, 2006 IP