How do I disable directory browsing?

后端 未结 12 583
灰色年华
灰色年华 2020-11-22 08:35

I want to disable directory browsing of /galerias folder and all subdirectories

Index of /galerias/409

* Parent Directory
* i126937298         


        
12条回答
  •  既然无缘
    2020-11-22 09:16

    The best way to do this is disable it with webserver apache2. In my Ubuntu 14.X - open /etc/apache2/apache2.conf change from

    
            Options Indexes FollowSymLinks
            AllowOverride None
            Require all granted
    
    

    to

    
            Options FollowSymLinks
            AllowOverride None
            Require all granted
    
    

    then restart apache by:

    sudo service apache2 reload
    

    This will disable directory listing from all folder that apache2 serves.

提交回复
热议问题