There is a folder with video files on the site, I want to prohibit a direct call to these files from the browser. But so that in the player on the site they still worked.

MB is something like if there is a referrer from the site then open access, although not sure.

  • What are you protecting yourself from? From posting videos on other sites? From downloading videos? - cronfy
  • From downloading. Although of course it is clear that this will not help, just a foolproof. - kapibara

1 answer 1

This technique is called "hotlink protection". But it can also be used for simple protection against downloading. It is based on checking the Referer header and is described in the mod_rewrite documentation .

Of course, if you wish, you can still download the file by substituting your own Referer header, since this header is sent by the user. Or download using the plugin. But from a simple download link this method protects.

In .htaccess you need to add a rule like this:

RewriteCond "%{HTTP_REFERER}" "!www.example.com" [NC] RewriteRule "\.(mp4|avi|mov)$" "-" [F,NC] 
  • one
    Thanks for the help. Suddenly, someone else will need to, added at the beginning of RewriteEngine On, without including mod_rewrite will not work) - kapibara