I'm writing to ask you for help. I manage a video site, my interest is to make an .mp4 file private, let me explain better.
Inside my web space there are videos that are managed with yendif video player since I use Joomla as CMs. Up to this point the problem does not arise because the user who needs to see the video must be logged in to do so.
The problem arises instead if the customer knows the direct link to the mp4 file for example (www.miosito.com/folder/folder/video.mp4) in this case the user can download it.
I tried two different solutions.
Turning to you, is there a way to make the video not accessible on the public side and at the same time used for viewing by the logged in user?
Thanks in advance.
you can use htaccess :
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^https://(www\.)?DOMAIN.com [NC]
RewriteCond %{HTTP_REFERER} !^https://(www\.)?DOMAIN.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?DOMAIN.com [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?DOMAIN.com.*$ [NC]
RewriteRule \.(mp3|mp4)$ - [F]
Create a hetaccess file in the ROOT_PATH/folder/folder directory next to your videos and put the above code in it.