HTAccess does not block sites?

2 replies
Hi,

I have been getting referrer spam so someone told me to use HTAccess to blog attempts from certain addresses. I have appended the following to the end of my HTAccess file in root (I have wordpress blog):

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_REFERER} premiumbags[OR,NC]
RewriteCond %{HTTP_REFERER} munichbambas [OR,NC]
RewriteCond %{HTTP_REFERER} gautamgoudar [OR,NC]
RewriteCond %{HTTP_REFERER} phistrackers[OR,NC]
RewriteCond %{HTTP_REFERER} ipodtouchrepair [OR,NC]
RewriteCond %{HTTP_REFERER} burnedsoul[OR,NC]
RewriteCond %{HTTP_REFERER} sn.im[OR,NC]
RewriteCond %{HTTP_REFERER} inventsource[OR,NC]
RewriteCond %{HTTP_REFERER} jaagers[OR,NC]
RewriteCond %{HTTP_REFERER} tu-berlin[OR,NC]
RewriteCond %{HTTP_REFERER} surfhighheels[OR,NC]
RewriteCond %{HTTP_REFERER} guru-articles[OR,NC]
RewriteCond %{HTTP_REFERER} income[OR,NC]
RewriteCond %{HTTP_REFERER} sex[OR,NC]
RewriteCond %{HTTP_REFERER} backlinks [NC]
RewriteRule \.html?$ - [F]

My understanding is that the Rewritecond will block anything with that word in the referring address, so any domain including the word sex is blocked.

But things are still getting through, so what have I done wrong here?
#block #htaccess #sites
  • Profile picture of the author andreasnrb
    You could try the suggestions in this post Battling Referrer Spam « Lorelle on WordPress
    {{ DiscussionBoard.errors[4459418].message }}
  • Profile picture of the author nthmarketing
    To block a single referrer

    Code:
    RewriteEngine on
    # Options +FollowSymlinks
    RewriteCond %{HTTP_REFERER} badsite.com [NC] 
    RewriteRule .* - [F]
    To block multiple referrers
    Code:
    RewriteEngine on 
    # Options +FollowSymlinks 
    RewriteCond %{HTTP_REFERER} badsite.com [NC,OR] 
    RewriteCond %{HTTP_REFERER} anotherbadsite.com 
    RewriteRule .* - [F]
    Hope that helps.

    Fred

    PS there should be a "\" in front of the .com but it is not showing up.
    {{ DiscussionBoard.errors[4459823].message }}

Trending Topics