我正在使用以下 .htaccess 来整理我的目录列表:
Options +Indexes
IndexOptions IgnoreCase FancyIndexing FoldersFirst NameWidth=* DescriptionWidth=* SuppressHTMLPreamble
HeaderName header.html
IndexIgnore header.html footer.html favicon.ico .htaccess .ftpquota .DS_Store icons *.log *,v *,t .??* *~ *#
它加载标题 html,其中包含:
<html><head><title>My Stuff</title>
<style type="text/css">
body {
background: #eee;
margin: 33px;
color: #333;
}
h1 {
font: 2.0em Georgia, serif;
}
h1 a:hover, h1 a:active {
text-decoration: none;
}
a:link {
text-decoration: none;
color: #555;
}
a:visited {
text-decoration: none;
color: #777;
}
a:hover, a:active {
text-decoration: underline;
color: maroon;
}
pre {
font: 0.9em/1.3em "Courier New", Courier;
margin: 3px 0;
color: #777;
}
pre img {
display: inline;
}
img {
margin: 3px 0;
}
</style>
</head>
<body><h1><a href="/test" title="My Atlassian Stuff">My Stuff</a></h1>
当我转到文件夹时看起来很棒/test/
。然而,当我去/test/test2/
它没有继承之前的htaccess,因此显示出无聊的默认样式。我怎样才能让它对下层子文件夹进行粘贴/递归?
Place a /
before header.html
告诉 Apache 每次都查看根目录。
HeaderName /header.html
EDIT:如果根目录中不存在 header.html 文件,请将路径更改为存储该文件的位置。
HeaderName /path/to/header.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)