Forum Moderators: phranque
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^http://mysite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://mysite.com$ [NC]
RewriteCond %{HTTP_REFERER}!^http://mysite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://mysite.com$ [NC]
RewriteRule .*\.(jpg¦jpeg¦gif¦png¦bmp¦swf)$ - [F,NC]
thx in advance for the help you guys;)
No, sorry, there isn't.
The problem is that media players do not provide the HTTP_REFERER variable that the code you posted relies on. When those media players request a file, HTTP_REFERER will be blank, and so fail the tests in the code and be blocked. So, you can't use a simple mod_rewrite method to protect such files against hotlinking.
This method works fairly well with fixed-image filetypes (gif, jpg, png) handled directly by the browser, but not those filetypes handled by external players.
You'll need to look into more sophisticated methods for protecting your movie clips and flash.
Jim