Apply .htaccess HeaderName to all lower levels?
I'm using the following .htaccess to spruce up my directory list:
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 .??* *~ *#
It loads header html which contains:
<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>&开发者_高级运维lt;h1><a href="/test" title="My Atlassian Stuff">My Stuff</a></h1>
It looks great when I go to the folder /test/
. However, when I go to /test/test2/
it doesn't pick up the previous htaccess, thus showing the boring default style. How can I make it stick/recursive for the lower laying subfolders as well?
Place a /
before header.html
to tell Apache to look to the root everytime.
HeaderName /header.html
EDIT: If your header.html file doesn't exist in the root, change the path to be where you have stored the file.
HeaderName /path/to/header.html
精彩评论