Denying access based on HTTP referer
To deny access to a site based on the referer URL, you can use Apache rewrite rules.
In the sample below, any referral that ends with .ru, .ua, or .tv will be rejected and redirected to the forbidden page (a 403).
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} \.(ru|ua|tv)$ [NC]
RewriteRule ^.* - [F]
To test the rule, you can use curl, like so:
curl -e ‘http://test.tv’ domain.com
Print article | This entry was posted by elvis on 01/13/12 at 07:05:00 am . Follow any responses to this post through RSS 2.0. |