Is there a way to stop users from typing in a url and gaining access to a file in a specific directory but still allow a PHP script to have access to the file to change it or download it?
In other words, I want to stop people from typing in: http://www.mysite.com/securefolder/file1.pdf. Maybe redirect them to a different page or something.
But I do not want to completely lock away the files because I still need to use a PHP script to download and modify the files.
Any help is appreciated,
Thanks
If all you want is a specific setting for a certain file a very simple rule will be all you need –
What might be a better idea is to make a rule for the entire secured folder –
One last (and probably best) way to do this is to create an additional
.htaccessinside the secured folder and simply deny all access to it. Place this one line –In all of the solutions, we are only talking about external requests. All your scripts and internal paths to scripts, files, etc… will remain intact and unaffected by the rules you define within the
.htaccessfiles.