Forum

Thread tagged as: Question

Stopping External Access to our Resources folder

We have pirates taking images out of our resources folder.

Will it cause any problem if I put a blank index.php file in this folder to stop direct access to it

Stefan Youngs

Stefan Youngs 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

No, or you could turn off directory indexes

https://linuxconfig.org/turn-off-directory-browsing-on-apache

Thanks for the advice

I don't know that our host would permit us to fiddle with apache.

I'll go the index.php route

Drew McLellan

Drew McLellan 2638 points
Perch Support

It can usually be done in your .htaccess file. Either method is fine.

Good to know. I certainly use our htaccess file for lots of stuff

Putting a blank index.php file did not do the trick. It stops people from browsing the folder, but still allows them to get in if they know the name of a file inside the folder, they can still download that file, which is what I want to stop

I tried putting an htaccess file in with

deny from all

but that stops our pages from getting to the images. I thought deny from all stopped external access but allowed pho access, but it seems I am wrong on that.

Do you have a suggestion for htaccess? Thanks

Rachel Andrew

Rachel Andrew 394 points
Perch Support

No, if a file is viewable on the web then it can be downloaded, because that is what happens when a browser displays an image. It downloads it.