mod_autoindex简单美化(Apache)

1.首要的就是去掉那个index of字样,

实在是太丑了。可是我无论怎么更换关键字,都找不到答案,于是硬着头皮看官方英文文档

终于在一堆如虫子的字样中找到这样一句话

SuppressHTMLPreamble
If the directory actually contains a file specified by the HeaderName directive, the module usually includes the contents of the file after a standard HTML preamble (<html>, <head>, et cetera). The SuppressHTMLPreamble option disables this behaviour, causing the module to start the display with the header file contents. The header file must contain appropriate HTML instructions in this case. If there is no header file, the preamble is generated as usual.
大意就是,如果作为头部文件的文档里面有完整的html头部标记,那么,SuppressHTMLPreamble这个选项会使得apache从头部文件里面显示heade标签,正是我想要的,否则,headfile里面的title标记是不会被解析的
看来在IndexOptions +SuppressHTMLPreamble 即可

2.其他美化选项(./htaccess)

[text]Options Indexes FollowSymLinks -ExecCGI -Includes
IndexOptions FancyIndexing -ScanHTMLTitles NameWidth=25 DescriptionWidth=128 VersionSort FoldersFirst SuppressHTMLPreamble Charset=UTF-8
IndexIgnore favicon.ico header.html footer.html images
HeaderName header.html
ReadmeName footer.html
AddDescription "我的应用" MyApps
IndexOrderDefault Ascending Name[/text]

3.以后补充
Author Info :
  • From:mod_autoindex简单美化(Apache)
  • URL:https://blog.ihipop.com/2010/02/602.html
  • Please Reserve This Link,Thanks!
  • 发表回复

    您的电子邮箱地址不会被公开。 必填项已用 * 标注