How can I block referral traffic from AND to a specific domain?

316 Views Asked by At

I need to block incoming traffic from Google using htaccess. The installation is running several domains, but I only need to block the traffic for one specific domain.

I've tried the following, but this always blocks all requests.

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^https?://(www\.)?google\.(com|de|fr|ch)
RewriteCond %{HTTP_HOST} ^(www\.)?example\.org [NC]
RewriteRule .* – [F]
1

There are 1 best solutions below

0
Mark Howells-Mead On

The code in my initial question is correct. I'd introduced a spelling error when modifying it for my specific server.