RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain\.com/ [NC] RewriteRule ^(.*\.jpg)$ /hotlink.php?fn=$1 [L]