
如果您存取沒有 index.html 的資料夾,Apache 允許您建立目錄清單(配置後)。
我想知道的是,是否可以透過不同的 URL 取得相同的清單?我已經在使用index.html並且想保持這種狀態。
即,這就是我正在尋找的:
http://example.com/blar/
->載入我的index.html頁面(不希望這個改變)
http://example.com/blar/directory_list
(我希望這個url來呈現apache目錄清單)
答案1
DocumentRoot /var/www
...
Alias /bar /var/www/foo
<Location /bar>
DirectoryIndex disabled
</Location>
現在http://domain.tld/foo/將顯示您的index.html,同時http://domain.tld/bar/會給你一個目錄索引。假設您的其他配置是這樣的。