Mobile app version of vmapp.org
Login or Join
Bethany197

: Well you can go here http://aaronlogan.com/downloads/htaccess.php and have a pretty big list of referrer spam blocks in your htaccess. Or you can use something like the following # set the spam_ref

@Bethany197

Well you can go here aaronlogan.com/downloads/htaccess.php and have a pretty big list of referrer spam blocks in your htaccess. Or you can use something like the following

# set the spam_ref variable - referrer site or a keyphrase
SetEnvIfNoCase Referer "^http://(www.)?some-spammer.com" spam_ref=1
SetEnvIfNoCase Referer "^http://(www.)?other-spammer.com" spam_ref=1
SetEnvIfNoCase Referer "^casino-poker" spam_ref=1

# block all referres that have spam_ref set
<FilesMatch "(.*)">
Order Allow,Deny
Allow from all
Deny from env=spam_ref
</FilesMatch>


Or if you are using php.

<?php
$block = array("xxx.xxx.xxx.xxx", "yy.yy.y.yyy");

if (in_array ($_SERVER['REMOTE_ADDR'], $block)) {
header("Location: google.com/ );
exit();
}
?>


Either way you will need to keep on top of it and update as necessary. And the list can get huge.

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Bethany197

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme