.htaccess deny

Discussion in 'Apache' started by moulikminda, Jun 30, 2009.

  1. #1
    How do i block the following range of ips?

    62.193.224.0 - 62.193.239.255
    66.232.96.0 - 66.232.127.255
    66.90.64.0 - 66.90.127.255
    67.55.64.0 - 67.55.127.255
    67.159.0.0 - 67.159.63.255
    67.222.128.0 - 67.222.159.255
    68.178.128.0 - 68.178.255.255
    69.72.128.0 - 69.72.255.255

    Thanks
     
    moulikminda, Jun 30, 2009 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Something like this:

    #62.193.224.0 - 62.193.239.255
    SetEnvIf Remote_Addr "^62\.193\.2(2[4-9]|3[0-9])\." dontlikeit
    #66.232.96.0 - 66.232.127.255
    SetEnvIf Remote_Addr "^62\.232\.(9[6-9]|1[0-1][0-9]|12[0-7])\." dontlikeit
    #66.90.64.0 - 66.90.127.255
    SetEnvIf Remote_Addr "^66\.90\.(6[4-9]|[7-9][0-9]|1[0-1][0-9]|12[0-7])\." dontlikeit

    # and so on ...

    Options -Indexes -Includes
    Order allow,deny
    Allow from all
    Deny from env=dontlikeit
     
    ajsa52, Jul 2, 2009 IP