Well, been struggling with this .htaccess file for some time now, and no matter what I can't seem to get it functional within a subdomain on a Unix FreeBSD server.

How do I change the code to make it work?

Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.ext/.*$ [NC]
RewriteRule \.(gif|GIF|jpg|JPG|css|CSS|js|JS|txt|TXT)$ - [F]