Try to add the following to your htaccess file.
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^
http://([a-z0-9-]+\.)*domain.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule /*
http://www.domain.com/ [L,R]
Nevermind. Just tried it and it didn't work....