Search code examples
filesystemsfile-permissions

Correct file permissions for website directory


I have a sub-domain for my website where I have all of my CSS, images, and various other files. What I am trying to do is make it inaccessible to the public if you go to the URL of say http://subdomain.domain/images but accessible if you go to the actual file, say http://subdomain.domain/images/image.jpg. I can't figure out what permissions should be on the files and folders, I only seem to make it all inaccessible or all accessible. The reason for this is because some of the files on the subdomain are going to be users personal files which they can view and upload through the website and an app, I obviously don't want these files to be publicly accessible.

I have tried Googling this and couldn't find anything that helped.


Solution

  • It looks like you don't want to fiddle with filesystems or file-permissions but with a setting in your webserver of choice to disable directory browsing/listing.