Jump to content

Recommended Posts

Posted

the longer i keep my site, the more i am seeing spam referrals in awstats (sites show up in referral list that never actually linked to my site). isn't there something i can add to my .htaccess file to keep this from happening?

Posted

Here is a link I found that might help. distant, early morning - Referral Spamming

 

 

 

I think it is something like;

 

RewriteEngine On

RewriteCond %{HTTP_REFERER} ^http://(www\.)?spamsite1.com.*$ [OR]

RewriteCond %{HTTP_REFERER} ^http://(www\.)?spamsite2.com.*$ [NC,OR]

RewriteCond %{HTTP_REFERER} ^http://(www\.)?spamsite3.com.*$ [NC,OR]

RewriteCond %{HTTP_REFERER} ^http://(www\.)?spamsite4.com.*$ [NC]

RewriteRule \.*$ http://www.some-other-website.com [R,L]

Posted

*blushes*

 

I am not good with .htaccess, and I have pulled this together from a variety of sources. If/when you look you'll note that there is some duplication.

 

This is my .htaccess file. WARNING: There are words that some may consider uh, adult content I suppose, in there. I had to block certain words and therefore those words may be reflected in the file. If another mod sees fit to remove the link I'll understand - if that happens, people can PM me.

 

Note that it starts from the second #Rewrite engine on "RewriteEngine On #only include this line once to enable the rewriting engine" and yes, there is some duplication - mostly because some of it works and some of it doesn't and I haven't had a chance to sit down and figure out what it all means (IE: I have not followed my own warning ;) ) also note this warning:

 

WARNING

 

I have done some *very generous* banning in that file - including ALL of blogspot.com! I *highly suggest* you do not implement this without at least some understanding or a look through to make sure it matches what you want, or you may ban more than you expected.

 

Therefore: Use of this is the responsibility of the user - especially if you just cut and paste the entire thing. .htaccess can be VERY powerful so be careful!

 

Ok, I'm done lecturing. =)

Posted

thanks folks! i'll give this a shot. what sucks is having to add such specific info to exclude stuff. seems like there should be some way of differentiating referrals that are valid form the spam, but i guess nobody ever thought this would become such a target.

Posted

These show up as referring sites in AWStats. It's done for a variety of reasons. Many people allow bots to spider their stats; and others show their referrers on their site (as a "plug back" I suppose, or bragging? ;) ) - so this can up their pagerank. And we all know pagerank is the end all, be all of existance *note sarcasm*

 

Jimmy: If you look through that .htaccess file you'll note that you can have "catch-alls" - for instance, I'm blocking all of "blogspot" - you could easily replace the blogspot blocks with say, "car" to block anything with "car" in the URL.

 

There is a different method that uses only keywords - however I had massive problems with that crashing people's browsers and going into a looped redirect.

 

BTW: These people will be delivered a 403 error - just in case you wanted to know. =)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...