How to Block IP Addresses & Specific visitors with .htaccess

Modified on Mon, 27 Mar 2023 at 02:22 PM

You can block unfriendly domains by adding the following to the .htaccess file in your websites public_html folder.

# Block referrer spam & Country
RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://.*avtovei.\.ru/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*livegif.\.ru/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*mapcenter\.ru/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*mcomp\.org/ [NC,OR]
RewriteRule ^(.*)$ – [F,L]

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article