How do I block specific referrers on my Apache server?

To block a specific referrer on your Apache server, edit the httpd.conf to include the following block:

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://(www\.)?badsite\.com
RewriteRule .* – [F]

This will cause the referrer to get a forbidden error (403) when they try to make a call to your website.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top