Click here to Skip to main content
15,887,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear reader,

Let's say I have a website "website.com" and this contains a simple "index.php".
This index.php contains the normal thinks and a button with an "a href" to website.com/clip/bird.mp4

With .htaccess I can prevent file trees from appearing (Options -Indexes).

But the file is still accesable through the direct link.

This site also contains a login page handeled with php and phpmyadmin.

Is there a way to prevent direct access, through php? .htaccess? or even server side? and if so how? and if not, how do sites like netflix or such do it?

Thanks in advance!

What I have tried:

I have tried searching google for hours now and also I tried to create rwx on the server side to --- but than it won't play it all (which was expected). Also I tried some .htaccess to prevent people from direct access but this prevents the index.php too.
Posted
Updated 7-Jun-17 9:43am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900