09. May 2008 · Comments Off · Categories: SEO · Tags: , ,

If you’re tired of getting spammed from a single referrer, rejoice. There’s no need to take it, and implementing a ban for a referrer is as easy as pie. That is, if you’re using mod_rewrite.

If you are using mod_rewrite, then you simply add a rule to your .htaccess files as follows:

RewriteCond %{HTTP_REFERER} offender\.com [NC]
RewriteRule .* – [F]

Merely replace the “offender” with the actual domain name of the offending website. Any referrer from that website will now get a 403 Forbiden message.

Problem solved.

Comments closed.