Forum Moderators: phranque

Message Too Old, No Replies

reWrites for WMV interfering with legit. playback

         

VicKickAss

12:13 am on May 1, 2004 (gmt 0)



Any help on the following is going to be VERY appreciated, since I am completely new to the world of Apache. Thanks in advance...

Here's my problem:

I am using rewrite rules to protect my media, not only from being used by other domains, but also from being accessed directly from the browser via a user figuring out the correct URL. Therefore I do not allow blank referers.

Here is the rule I am using (with a real IP and domain name, of course):


RewriteEngine on
RewriteCond %{HTTP_REFERER}!^http://?1.1.1.1(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mydomain.com(/)?.*$ [NC]
RewriteRule .*\.(gif¦jpg¦jpeg¦bmp¦wmv¦mov)$ - [F,NC]

This works great until a page on my site attempts to view a wmv using the embedded active-x Media Player... it complains that it cannot find the file - which means that the rewrite rule is blocking it.

However, gif and jpg, etc work fine.

I guess the problem may have something to do with the media player having a blank referrer?

Can someone help me grant legitimate access to my wmv content, while disallowing people from hotlinking it, or getting to it directly via the url?

jdMorgan

12:59 am on May 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There's no way to do it that I know of, except to use a script to feed the files based on cookies or sessions. Media player does not provide a referrer.

Jim