Блокировка запросов по Referer в Apache

Требования:
mod_rewrite
htaccess

Конструкция следующая

RewriteEngine on
RewriteCond %{HTTP_REFERER} badsite1\.com [NC,OR]
RewriteCond %{HTTP_REFERER} badsite2\.com [NC]
RewriteRule .* - [F]

Hotlink защита

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^(http(s)?://)?(www.)?YOUR-SITE\.NET [NC]
RewriteCond %{HTTP_REFERER} !^(http(s)?://)?(www.)?SUB\.YOUR-SITE\.NET [NC]
RewriteRule \.(jpg|gif|ico|avi)$ - [F,NC]