禁止 Apache 顯示目錄列表

2021-06-21 12:10:52 字數 460 閱讀 8272

如何禁止 apache 顯示目錄列表呢?

要禁止 apache 顯示目錄結構列表,只需將option中的indexes去掉即可

比如我們看看乙個目錄的目錄配置:

options indexes followsymlinks

allowoverride none

order allow,deny

allow from all

你只需要將上面紅色**中的indexes去掉,就可以禁止 apache 顯示該目錄結構。使用者就不會看到該目錄下的檔案和子目錄列表了。

indexes的作用就是當該目錄下沒有 index.html 檔案時,就顯示目錄結構,去掉indexes,apache 就不會顯示該目錄的列表了。

Apache禁止顯示目錄結構

開啟檔案 httpd vhosts.conf 如果你的檔案根目錄裡有 index.html,瀏覽器就會顯示 index.html的內容,如果沒有 index.html,瀏覽器就會顯示檔案根目錄的目錄列表,目錄列表包括檔案根目錄下的檔案和子目錄。如果該虛擬目錄下沒有 index.html,瀏覽器也會顯...

禁止Apache顯示目錄的方法

所有配置均針對conf httpd.conf檔案。禁止apache顯示目錄的方法是刪除 options indexes followsymlinks 中的 indexes 項 options indexes followsymlinks allowoverride none order allow,...

禁止apache顯示目錄索引的常見方法

禁止apache顯示目錄索引,禁止apache顯示目錄結構列表,禁止apache瀏覽目錄,這是網上提問比較多的,其實都是乙個意思。下面說下禁止禁止apache顯示目錄索引的常見的3種方法。要實現禁止apache顯示目錄索引,只需將 option 中的 indexes 去掉即可。1 修改目錄配置 如下...