Code / plugin to block traffic from a specific website or page?

Status
Not open for further replies.

SleepyStarling

The Narcoleptic Queen
Mar 21, 2007
102
1
0
Is there a line of code or a plugin for Wordpress that will allow me to block all traffic coming from a specific website? WP-Ban allows me to ban by IP, but that would only ban the owner, not all of the referral traffic. Any help would be appreciated. Thanks!
 


I think you'd have to ban all the IPs...if it's free traffic who cares? Or is the site leeching?
 
It's to stop potential click fraud. So there's no way to redirect based on the referring url?
 
Code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www\.)?referringdomain\.tld/ [NC]
RewriteRule .* http://sendmetoanotherplace.com/ [R,L]

edit your .htaccess
 
Put this in your .htaccess file. xxx is obviously the IP you want to block.

Deny from xxx.xxx.xxx.xxx
 
Status
Not open for further replies.