Looking for help blocking referring sites

  • Answered
First off I could NOT login into this system. Ticket was created by a support staff/chat without letting me know they were doing it. Bad form Malcolm. always let someone know what you are doing.

I had code downloaded from another site that seems to be correct but I did have a question. If the site is a .ru account should the code read -

RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} badsite\.ru[NC]
RewriteRule .* - [F]

where the site name to block replaces badsite

Hi EjNeilsen, I just wanted to confirm, are you tracking to block IP addresses that are Russian, or are you trying to block traffic that originates from Russian IP addresses? Blocking Russian IP Addresses There's a website, ip2location.com, that allows you to block traffic from Russian IP addresses. It appears what they do is keep track of IP blocks that are available in Russia, and they provide you with a list of all of the IP address blocks (including the necessary .htaccess code to block them). Blocking domain's based upon referer I tried the code you provided, but I was not able to get it to work successfully. I searched the web to find a few other examples, and I was able to get the following working:
# Configure which sites to block SetEnvIfNoCase Referer "^http://(www.)?badsite.ru" spam_ref=1 SetEnvIfNoCase Referer "^http://(www.)?badsite2.ru" spam_ref=1 # Block the websites that match <FilesMatch "(.*)"> Order Allow,Deny Allow from all Deny from env=spam_ref </FilesMatch>
I found this code sample here. I hope this helps! Feel free to post a comment at the bottom of this page if you have any follow up questions. Thanks, - Brad