Proper way to block Referer Spam in httpd.conf by keyword

Discussion in 'Apache' started by hchoate, May 29, 2012.

  1. #1
    I am being plagued by referrer spam that is spoofing as Google 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.
     
    hchoate, May 29, 2012 IP