How do I disable directory browsing?

后端 未结 12 601
灰色年华
灰色年华 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:08

    Create an .htaccess file containing the following line:

    Options -Indexes
    

    That is one option. Another option is editing your apache configuration file.

    In order to do so, you first need to open it with the command:

    vim /etc/httpd/conf/httpd.conf
    

    Then find the line: Options Indexes FollowSymLinks

    Change that line to: Options FollowSymLinks

    Lastly save and exit the file, and restart apache server with this command:

    sudo service httpd restart
    

    (You have a guide with screenshots here.)

提交回复
热议问题