2011-01-05 4 views
5

私は、ディレクトリのリストを整えるために、次の.htaccessを使用しています:私はフォルダ/test/に行くとき、それは偉大に見える.htaccessヘッダー名をすべての下位レベルに適用しますか?

<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> 

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をロードします。しかし、/test/test2/に行くと、以前のhtaccessは取得されず、退屈なデフォルトスタイルが表示されます。私はそれを下位の敷設サブフォルダにスティック/再帰的にすることもできますか?

答えて

6

header.htmlの前に/を置き、毎回ルートを探すようにApacheに指示します。

HeaderName /header.html 

EDIT:あなたのheader.htmlファイルがルートに存在しない場合は、ファイルを保存している場所であることをパスを変更します。

HeaderName /path/to/header.html 
+1

男の中の神、それはあなたです:-)ありがとう! – FLX

関連する問題