Reputation: 10066
All, I'm getting a lot of traffic to my website from back links and it's affecting my google analytics. Is there a way to block a specific website from accessing my website through .htaccess? For example purposes, if I want to block http://foo.com how would I do that? Is there a better way then .htaccess?
Thanks in advance!
Upvotes: 0
Views: 1731
Reputation: 9539
Try adding the following to your .htaccess file
#if the request came from foo.com
RewriteCond %{HTTP_REFERER} ^http://foo\.com$
#then serve it a 403 Forbidden
RewriteRule . - [F,L]
Upvotes: 3