Domain Manage

Blocking IP range help with .htaccess

Discussion in 'General Board' started by Alien, May 5, 2011.

Thread Status:
Not open for further replies.
  1. Alien

    Alien Well-Known Member

    Joined:
    May 2006
    Posts:
    5,921
    Likes Received:
    57
    Hi all,

    Can anyone kindly assist me with creating an .htaccess file to block an IP range which is spamming several sites on my server?

    I'm getting spam from an originating T-Mobile IP range of 178.100.0.0 - 178.103.255.255. T-Mobile won't do anything about it and never reply. :rolleyes:

    So, rather than use the WHM to blanket ban T-Mobile users with a wildcard on the entire server, I'd like to individually upload an .htaccess file to block several sites only.

    How do I block the entire range as above?

    e.g. Would this work?

    Code:
    order allow,deny
    deny from 178.*.*.*.*
    allow from all
    Help gratefully received, thanks! :D
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
     
  3. Ashton United Kingdom

    Ashton Well-Known Member

    Joined:
    Feb 2010
    Posts:
    1,621
    Likes Received:
    29
    This should work:

    order allow,deny
    deny from 178.
    allow from all

    You can also block specific ISPs
     
  4. illtemper

    illtemper Active Member

    Joined:
    Oct 2007
    Posts:
    65
    Likes Received:
    2
    If you really want to block the whole 178 range then the following would do it:

    Code:
    deny from 178.
    
    edit:
    I was picked at the post before refreshing the page.
     
    • Like Like x 1
  5. Ashton United Kingdom

    Ashton Well-Known Member

    Joined:
    Feb 2010
    Posts:
    1,621
    Likes Received:
    29
    Haha, great minds think alike.

    Btw I don't think you are allowed affiliate links in your sig here.
     
    • Like Like x 1
  6. Alien

    Alien Well-Known Member

    Joined:
    May 2006
    Posts:
    5,921
    Likes Received:
    57
    Thanks guys, much appreciated. :)

    I've uploaded my individually needed .htaccess files and will see what happens. :cool:
     
Thread Status:
Not open for further replies.

Share This Page