Actualmente estoy tratando de crear un índice para las carpetas que lo utilizarán. El problema que tengo es con el HeaderName y el FooterName . Simplemente no se aplican al índice. El archivo header.html contiene lo siguiente:
<html> <head> <title>My Stuff</title> <style type="text/css"> body { background: #eee; margin: 33px; color: #333; } </style> </head> y el archivo .htaccess tiene lo siguiente:
# enable indexes Options +Indexes # htaccess protection <Files ~ "^.*\.([Hh][Tt][Aa])"> order allow,deny deny from all </Files> # directory customization <IfModule mod_autoindex.c> # index options IndexOptions IgnoreCase IndexOptions FancyIndexing IndexOptions FoldersFirst IndexOptions NameWidth=* IndexOptions DescriptionWidth=* IndexOptions SuppressHTMLPreamble # display order IndexOrderDefault Descending Name # page customization HeaderName header.html ReadmeName footer.html # ignore page customization files and others IndexIgnore header.html footer.html favicon.ico .htaccess .ftpquota .DS_Storeicons *.log *,v *,t .??* *~ *# errorlog </IfModule> ¿Cómo puedo arreglar esto? Simplemente no puedo hacer que funcione y he borrado mi caché (varias veces) y también lo he probado en otros navegadores. He estado siguiendo un tutorial sobre cómo configurar esto (ya que no estoy familiarizado con el archivo .htaccess y cosas relacionadas) .
La fuente HTML que obtengo del índice es la misma que la predeterminada, por lo que no puedo saber si está haciendo algo. También puedo decir que todo el material está en la carpeta del juego, lo que lo hace más confuso.
No estoy seguro de qué versión de Apache estoy ejecutando porque el host/panel que estoy usando no lo muestra. He echado un vistazo y no lo encuentro. Lo más probable es que sea el más utilizado, ya que la mayoría de las cosas que he hecho han funcionado sin errores. No recibo errores del .htaccess tampoco.
Acabo de encontrar esto mientras investigaba IndexOptions y decidí probar.
Y parece funcionar para mí (Chrome, usando un servidor LAMP en hostpapa.com)
Demostración en: http://www.wsurvey.org/stackOverflow/testIndexOptions/
Puede ver la fuente de la página para verificar que SuppressHTMLPreamble funciona
El .htaccess:
# test of indexOptions Options +Indexes <IfModule mod_autoindex.c> # index options IndexOptions IgnoreCase IndexOptions FancyIndexing IndexOptions FoldersFirst IndexOptions NameWidth=* IndexOptions DescriptionWidth=* IndexOptions SuppressHTMLPreamble # display order IndexOrderDefault Descending Name # page customization HeaderName header.html ReadmeName readme.txt # ignore page customization files and others IndexIgnore header.html footer.html favicon.ico .htaccess .ftpquota .DS_Storeicons *.log *,v *,t .??* *~ *# errorlog </IfModule>y el header.html es (feo, pero muestra que funciona)
<html> <head> <title>This is a title</title></title> <style type="text/css"> body,.foo { background: tan; margin: 33px; color: blue; } .foo { background:cyan; } </style> </head> <body> <div class="foo" >This is content in header.html !</div>