homepage Welcome to WebmasterWorld Guest from 54.166.255.168
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
mod rewrite and wmv files
benway

10+ Year Member



 
Msg#: 389 posted 10:04 am on Sep 15, 2003 (gmt 0)
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?

 

closed

10+ Year Member



 
Msg#: 389 posted 5:47 pm on Sep 16, 2003 (gmt 0)

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?

keyplyr

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



 
Msg#: 389 posted 6:44 pm on Sep 16, 2003 (gmt 0)


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.

jdMorgan

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



 
Msg#: 389 posted 7:51 pm on Sep 16, 2003 (gmt 0)

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

closed

10+ Year Member



 
Msg#: 389 posted 9:30 pm on Sep 16, 2003 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved