PDA

View Full Version : Hot Linking


webhost
03-22-2002, 03:50 AM
I got a customer of mine, and he is saying he thinks alot of his rm songs are behing hotlinked

i tired everything from htaccess (rewrite) to a download.cgi?file.pm script.....

nothing works with the rm files, the images are blocked just fine, but not the embedded songs

The mod rewrite looks like this




RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.domain.com [NC]
RewriteCond %{HTTP_REFERER} !^http://domain.com [NC]
RewriteRule .*.(gif|GIF|jpg|JPG|mpg|MPG|Mpeg|mpeg|MPEG|rm|RM)$ http://www.domain.com [R,L]




The way im testing looks like this



<HTML>
<HEAD>
<TITLE>Sounds of Yesteryer, Featuring Old Time Radio (OTR), and other sounds from the Past</TITLE>
</HEAD>
<P ALIGN="center"><IMG BORDER="0" SRC="http://domain.com/001Yesteryearlogo.jpg"></P>
<H1 ALIGN="center"><EMBED SRC="http://domain.com/intro.rm" WIDTH="250" HEIGHT="35" nolabels="true" CONTROLS="ControlPanel" autostart="true">
</H1>
</BODY>
</HTML>

Logician
03-25-2002, 09:43 AM
My suggestion is not as easy as a simple change in .htaccess file but it will certainly work:

You may put the files on MYSQL and give them access from a PHP script. In your script you can check "referer" and disallow users who do not access the files via clicking your relevant web page.