Forum Moderators: phranque

Message Too Old, No Replies

Hotlink protection problem!

everytime i hotlink my site, my files won't play!

         

robobat

8:15 am on Feb 2, 2005 (gmt 0)

10+ Year Member



Hi, new at WW and i have a question regarding hotlink protection. When i go into my cpanel and enable hotlink...and then go to my site. All my files won't play! my movie clips and flash files won't play. There must be a way so that i can have hotlink and play my files. maybe that is how my cpanel works. here is what it looks like:

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;)

jdMorgan

3:43 pm on Feb 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> There must be a way so that i can have hotlink and play my files.

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

robobat

9:16 pm on Feb 3, 2005 (gmt 0)

10+ Year Member



Oh i c, thx for the help.