Apache中目录的Option设置为Indexes后,文件和文件夹将列表出来,其中有一项是‘描述’
Description的,这个属性可以对文件进行一些描述,但是如何赋值呢?
查看apache的手册,我们可以找到这个属性:
AddDescription Directive
例如
AddDescription "The planet Mars" /web/pics/mars.gif
这样就可以给每个文件定义描述文字.
但是有没有办法让apache自动读取html的title标记,自动生成描述文字呢?继续查找手册,也有答案:
ScanHTMLTitles
This enables the extraction of the title from HTML documents for fancy indexing. If the file does not have a description given by
AddDescription
then httpd will read the document for the value of the
title
element. This is CPU and disk intensive.
使用ScanHTMLTitles就可以让apache自动读取html文档的title标记了,例:
IndexOptions FancyIndexing ScanHTMLTitles