Apache2 AutoIndex 功能設定

由於要用到 Apache 下的自動排列目錄下檔案的功能,沒設定的話,預設 apache 會排得很難看,所以設定 apache 所有的目錄排列方式如下,加上 IndexOptions 的功能:

<IfModule dir_module>
IndexOptions Charset=UTF-8 HTMLTable NameWidth=*
DirectoryIndex index.html index.html.var
</IfModule>

Charset=UTF-8 是讓 AutoIndex 的網頁以 UTF-8 碼呈現。

HTMLTable 顧名是排列的像表格一樣。

NameWidth=* 是為了讓完整的檔名出現,apache 預設的,檔名太長會被切掉。

資料來源:
http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html


Posted

in

by

Tags: