htaccess that hides only directories [duplicate]

3

I created a assets directory to put the assets of my project. So far so good, however, I have found that by typing in the URL localhost/project/assets , it shows the directory structure of that folder. In order to prevent this action, I created a .htaccess file in the assets directory:

Deny from all

Creating .htaccess in the above prevented directory view, but caused an error: no files, either CSS or JavaScript are loaded from this folder.

So, my question is:
Is there a way to hide only the directories , leaving yet their files for my own application?

    
asked by anonymous 18.10.2017 / 23:27

1 answer

2

Only try this in your .htaccess file:

Options -Indexes
    
18.10.2017 / 23:32