Web Hosting Talk







View Full Version : hotlinking


AlaskanWolf
03-22-2002, 01:43 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>



Suggestions?

priyadi
03-22-2002, 06:04 AM
It is possible that files referenced from an embed tag don't emit a proper referer header. If that's the case, try removing this line: "RewriteCond %{HTTP_REFERER} !^$".

AlaskanWolf
03-22-2002, 06:24 AM
:) worked! thanks

edit

Looks like i spoke too soon, it looks like it stops even local files from being linked

priyadi
03-22-2002, 10:18 AM
Originally posted by AlaskanWolf
:) worked! thanks

edit

Looks like i spoke too soon, it looks like it stops even local files from being linked

What do you mean by it stops even local files from being linked?

By removing the line on my last post, the intended behavior is: server will refuse serving files in question whenever referer header is either not present or doesn't come from www.domain.com or domain.com.

So... the following will not work:
- accessing the URL directly by typing http://domain.com/foo.rm into browser window.
- referencing the rm file from an html file resides in local filesystem

Both of the above will result in nonexistant referer header.

AlaskanWolf
03-22-2002, 04:30 PM
after loading what you stated, i went to the primary website and none of the images would even load

priyadi
03-22-2002, 08:02 PM
The images won't load but the rm file loads? If that's the case try splitting the directives for rm files and images.

And, have you tried different browsers?