How do I disable direct access to files other than my php pages which are able to

  • Thread starter Thread starter simonth
  • Start date Start date
S

simonth

Guest
list them for download? Mine is a Linux server
I want to clarify on some points brought up:

My objective is to prevent someone who knows the exact URL to download the files directly. The files are for a secured section in my website.

I am also unable to store the files a level above the web root as the hosting company does not allow it. I am only able to see my web root folder and below.

Is there a way .htaccess file can resolve this?
 
If for example you mean a folder that for example contains images. Eg. yoursite.com/images and when you navigate to that page you get a list of those files, you could easily solve this by uploading a file to that folder called index.html. In the file just put something like
<html>
<body>
Access Denied
</body>
</html>.

This will redirect that folder to the index file instead of listing all the files available.
 
Back
Top