RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(.*)\.yoursite\.com/(.*)$ [NC] RewriteRule .*\.(swf|mp3|wmv|mpg|mpeg|jpg|jpeg|gif|png)$ http://www.yoursite.com/ [R, NC]