mod_autoindex的apache HeaderName指令不生效

mod_autoindex的apache HeaderName指令不生效,apache,httpd.conf,mod-autoindex,Apache,Httpd.conf,Mod Autoindex,我不能让我的文件列表以名为header.html的html文件开头。 下面是我的整个httpd.conf文件 #basic config ServerRoot "D:/phpnow/Apache-22" Listen 8888 ServerAdmin i@tunps.com ServerName localhost DocumentRoot "D:/" Options Indexes #dir_module LoadModule dir_module modules/mod_dir.so #&l

我不能让我的文件列表以名为header.html的html文件开头。 下面是我的整个httpd.conf文件

#basic config
ServerRoot "D:/phpnow/Apache-22"
Listen 8888
ServerAdmin i@tunps.com
ServerName localhost
DocumentRoot "D:/"
Options Indexes
#dir_module
LoadModule dir_module modules/mod_dir.so
#<IfModule dir_module>
#    DirectoryIndex index.html
#</IfModule>
#alias_module
LoadModule alias_module modules/mod_alias.so

#autoindex_module
#Alias /icons/ "D:/phpnow/Apache-22/icons/"
LoadModule autoindex_module modules/mod_autoindex.so
DefaultIcon /icons/unknown.gif
IndexOptions FancyIndexing  
HeaderName /header.html
web浏览器输出为:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
 <head>
  <title>Index of /</title>
 </head>
 <body>
<h1>Index of /</h1>
<pre>      <a href="?C=N;O=D">Name</a>                    <a href="?C=M;O=A">Last modified</a>      <a href="?C=S;O=A">Size</a>  <a href="?C=D;O=A">Description</a><hr><img src="/icons/unknown.gif" alt="[DIR]"> <a href="$RECYCLE.BIN/">$RECYCLE.BIN/</a>           09-Jan-2011 17:59    -   

<img src="/icons/unknown.gif" alt="[DIR]"> <a href="test/">test/</a>               26-Dec-2010 21:10    -  
<hr></pre>

</body></html>

索引/
索引/

2011年1月9日17:59- 2010年12月26日21:10-

如果您使用的是Apache 2.2,请确保您已取消注释该行,以使用httpd.conf中的花式目录列表


Include conf/extra/httpd autoindex.conf必须解析为主要内容类型为
text/*
(例如
text/html
text/plain
)的文档。在windows上,您的配置中需要有
AddType text/html.html

很好的建议,但是路径
D:/phpnow/Apache-22
会建议前者,而上面OP的
httpd.conf
中包含的
索引项FancyIndexing
应该考虑后者。在2019年的遥远未来,我也遇到了同样的问题。还有其他想法吗?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
 <head>
  <title>Index of /</title>
 </head>
 <body>
<h1>Index of /</h1>
<pre>      <a href="?C=N;O=D">Name</a>                    <a href="?C=M;O=A">Last modified</a>      <a href="?C=S;O=A">Size</a>  <a href="?C=D;O=A">Description</a><hr><img src="/icons/unknown.gif" alt="[DIR]"> <a href="$RECYCLE.BIN/">$RECYCLE.BIN/</a>           09-Jan-2011 17:59    -   

<img src="/icons/unknown.gif" alt="[DIR]"> <a href="test/">test/</a>               26-Dec-2010 21:10    -  
<hr></pre>

</body></html>