Ban an IP address - Is this correct?

Discussion in 'Apache' started by ian_ok, Feb 16, 2006.

  1. #1
    In my htaccess I want to ban a certain address, what I'm thinking of adding is below in RED is tis correct?

    How could I send the BOT off to another site or other?

    How could I add a range of IP's to ban?

    Is this a safe mode of banning an ip address and doesn't risk banning other users - PS it's from China so not my market area!:

    <Limit GET POST>
    order deny,allow
    deny from all
    deny from xx.xx.1x9.27
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>


    Thank

    Ian
     
    ian_ok, Feb 16, 2006 IP
  2. ian_ok

    ian_ok Peon

    Messages:
    551
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well i don't know if the above was/is correct? BUT I tried this:

    But it seemed to ban everyone, as i couldn't get access! The 'x' is a number which I have removed for displaying on the forum.

    This is what i added to the htaccess file:
    #Ip ban
    order allow,deny
    allow from all
    deny from x1.xx2.xx9.x7

    What am I doing wrong???

    Ian
     
    ian_ok, Feb 16, 2006 IP
  3. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I use this during development to deny all and allow myself:

    
    order deny,allow
    deny from all
    allow from 81.135.xxx.194
    Code (markup):
    Based on that, your should work like this I'd imagine:

    
    order deny,allow
    deny from 81.135.xxx.xx
    allow from all
    Code (markup):
    Maybe the last two lines in reverse order.

    PM me if you want my IP to test.
     
    T0PS3O, Feb 16, 2006 IP
  4. ian_ok

    ian_ok Peon

    Messages:
    551
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks Top's I'll have a go and get back to you later if I need a test IP.
     
    ian_ok, Feb 16, 2006 IP
  5. ffeingol

    ffeingol Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I don't believe you can put wildcards in the IP address. You can put in partial address like:

    Deny 10.1

    or use netmasks like:

    Deny 10.1.1.0/255.255.255.192
     
    ffeingol, Feb 16, 2006 IP