Welcome to WebmasterWorld Guest from 54.146.174.220

Forum Moderators: Ocean10000 & incrediBILL & phranque

mod rewrite and wmv files

   
10:04 am on Sep 15, 2003 (gmt 0)

10+ Year Member


I am trying to prevent hotlinking of my windows media movies, .wmv files. I used the following code:

Rewriteengine on
RewriteCond %{HTTP_REFERER}!^http://domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.domain.com/.*$ [NC]
RewriteRule \.(wmv)$ - [F]

The problem seems to be that the windows media player is accessing the file from a domain other than mine, its own domain, so I am blocked from getting the file even if coming validly from domain.com... does that make sense? Is there a way around this?

5:47 pm on Sep 16, 2003 (gmt 0)

10+ Year Member



Welcome to WebmasterWorld [webmasterworld.com], benway!

You may want to check your server's logs. When I try accessing files with WMP, it shows no referer. You'll have to add an extra RewriteCond to account for that.

Added:
Now that I've thought about it, mod_rewrite probably isn't the way to tackle this problem. You may want to consider other ways of restricting access to your files. Password protection maybe?

6:44 pm on Sep 16, 2003 (gmt 0)

WebmasterWorld Senior Member keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month




WMP copies files to it's own play list. That's why you can still play them from your desktop without being connected to the internet. If you freely offer media files on your website, there's no way you can prevent WMP from making it's own copy. By forbidding remote referrers for .wmv, you are not allowing WMP to operate the way it's set-up to work.
7:51 pm on Sep 16, 2003 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Allowing blank referrers will probably fix this problem.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com/ [NC]
RewriteRule \.wmv$ - [F]

It does open a hole in the protection, but allows WMP to work properly.

Jim

9:30 pm on Sep 16, 2003 (gmt 0)

10+ Year Member



That's what I thought, Jim, but I think everyone would have a no referer. That's why I think it won't work.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month