2011-01-05 10 views
5

estoy usando el siguiente .htaccess para arreglar mi lista de directorios:¿Aplicar .htaccess HeaderName a todos los niveles inferiores?

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 .??* *~ *# 

Se carga html cabecera que contiene:

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

Se ve muy bien cuando voy a la carpeta /test/. Sin embargo, cuando voy al /test/test2/, no recupera el htaccess anterior, mostrando así el aburrido estilo predeterminado. ¿Cómo puedo hacer que sea pegajoso/recursivo para las subcarpetas de colocación inferior también?

Respuesta

6

Coloque un / antes de header.html para indicarle a Apache que busque en la raíz cada vez.

HeaderName /header.html 

EDIT: Si el archivo header.html no existe en la raíz, cambie la ruta a ser el que ha almacenado el archivo.

HeaderName /path/to/header.html 
+1

Un dios entre los hombres, eso es lo que eres :-) Gracias! – FLX

Cuestiones relacionadas