How to disable directory indexing from apache2 when going to the server's root?

后端 未结 6 2264
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-12 12:11

I need to disable that indexing when I enter on my root directory on a apache2 server, any tips?

6条回答
  •  花落未央
    2021-02-12 12:35

    Edit your apache2 configuration file which normally is on the dir: "/etc/apache2/httpd.conf".

    Add the following or edit if your already have some configurations for the default web server dir (/var/www):

     
       Options -Indexes
       AllowOverride All
       Order allow,deny
       Allow from all
     
    

    This will disable the indexing to all the public directories.

提交回复
热议问题