.htaccess to block direct access to videos

Discussion in 'Apache' started by THT, Nov 9, 2010.

  1. #1
    I want to stop people directly downloading a video from my site.
    However, I want it still to be playable from within the HTML5 video player.

    I thought I could do this with .htaccess to ensure the referer was from my site, so I did this:

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^https://www\.mysite\.com [NC]
    RewriteRule \.(m4v)$ - [F,NC,L]
    
    Code (markup):
    Why isnt this working?
     
    THT, Nov 9, 2010 IP
  2. rehash

    rehash Well-Known Member

    Messages:
    1,502
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    150
    #2
    check your apache logs and see what kind of referral you have from the video player
    also RewriteCond %{HTTP_REFERER} !^https://www\.mysite\.com/.*$ [NC]
     
    rehash, Nov 11, 2010 IP