本地web環境,怎麼配置,存取可以顯示文件目錄?
不是很專業,這個問題不知道專業怎麼說,所以百度不到,就暈死。
求高手指點一下
httpd-vhost.conf 虛擬主機的設定:
请输入代码
<VirtualHost *>
DocumentRoot ./htdocs/book
ServerName www.book.com
ErrorLog logs/boook-error_log
</VirtualHost>
習慣沉默2017-05-16 17:05:18
如果是在apache下的話,設定如下:
方式一:httpd.conf
开启mod_autoindex
模組(預設是開啟的)
開啟列目錄功能:Options +Indexes
關閉列目錄功能:Options -Indexes
方式二:
根目錄.htaccess
檔案中新增
<Files *>
Options -Indexes
</Files>
给我你的怀抱2017-05-16 17:05:18
<VirtualHost *>
DocumentRoot ./htdocs/book
ServerName www.book.com
ErrorLog logs/boook-error_log
<Directory "./htdocs/book">
Options Indexes
Order allow,deny
IndexOptions NameWidth=25 Charset=UTF-8
Allow from all
</Directory>
</VirtualHost>
試試以上配置,不行的話把配置裡面的路徑都換成絕對路徑再試試、