1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Proper way to block Referer Spam in .httpd by keyword

Discussion in 'General Discussion' started by hchoate1, May 29, 2012.

  1. hchoate1

    hchoate1 New Member

    Joined:
    May 29, 2012
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I am being plagued by referrer spam that is spoofing as Goodle and am tired of playing whack-a-mole with the IPs so instead would like to block any referals that contain the phrase

    Article Dashboard

    regardless who it is from for all sites.

    Will this do it:?


    <Directory "/home/*/public_html">
    setenvifnocase referer "^http://.*(Article Dashboard)" spam_ref=1
    Order Allow,Deny
    Allow from all
    Deny from env=spam_ref
    </Directory>

    And is it the proper syntax to include in httpd.conf via

    Pre VirtualHost Include in WHM

    Thanks much.
     
  2. cPanelTristan

    cPanelTristan Active Member
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,621
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    Do you have mod_security installed? You might instead consider using mod_security for restricting these type of access. Here's a guide on using mod_security for this type of block:

    Stopping Comment / Referrer Spam
     
  3. hchoate1

    hchoate1 New Member

    Joined:
    May 29, 2012
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the suggestion. Apparently mod_security is not installed but that can probably be done.

    In the meantime, do you know

    Can mod_security be used in httpd.conf so I don't have to update all the .htaccess files?
    Does mod_security handle phrases as well as single words- the docs are not clear on that?
    Will my original scenario work?

    Thanks much.
     

Share This Page