Jump to content

need help writing a proper rule to block referrer in htaccess


schwim

Recommended Posts

Hi there guys!

I'm having a problem on one of my community sites:

My referrers are being spammed.  It was easy to block initially, because keywords were in the URL's that would never be found in a legitimate keyword for my site, and I could safely block them.  Now the spammers are using ambiguous URL's in hopes of a click to sell their wares, no longer relying on keywords in the URL:

Old referrer: http:// www . buyillegalviagra . com
New referrer: http:// www . mormonsarecool . com/#

the majority of the spam referrers have "/#" appended to them, so I thought I'd simply add a rule blocking that, but I'm having a problem doing that.  Here's my current method of blocking via htaccess:

[code]
SetEnvIfNoCase Referer "^/\#" BadReferrer

order deny,allow
deny from env=BadReferrer
deny from 80.227.0.153
deny from 69.16.200.85

<Files 403.shtml>
order deny,allow
allow from all
</Files>


ErrorDocument 403 /403.shtml
ErrorDocument 404 /404.shtml
[/code]

but it's not working.  I created a page linking to my site on another domain, and accessed it with a pound sign at the end of the URL, and when linking, it doesn't get blocked.

How do I get my current rule to block any referrers ending with "/#"?

I'm very appreciative of any help you might be able to provide.

thanks,
json
Wehheell, thanks for everything guys!

It may take me some time to try all of these suggestions, but I promise I will get back to you with a full report of how each of these worked.  It's the least I can do for all the time you've put into it.

Again, thanks so much.  I'm humbled at the level of enthusiasm.

thanks,
json

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.