用途:在目錄下如果沒有默認首頁面(如index.html default.htm)時防止用戶訪問web時瀏覽目錄
打開httpd.conf
查找Options Indexes FollowSymLinks
修改為:
Options -Indexes FollowSymLinks
修改保存退出,重新啟動apache
訪問http://127.0.0.1如果看到以下提示說明修改成功
Forbidden
You don't have permission to access / on this server.
Apache/2.0.53 (Unix) Server at 192.168.0.1Port 80 ? ? ? 開啟瀏覽: <Directory />
??? Options FollowSymLinks
??? AllowOverride None
??? Options Indexes?????????? #就加這句就可以了,目錄按需要選擇
</Directory>