php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7868 mod_autoindex breaks when php handles .html files
Submitted: 2000-11-17 17:18 UTC Modified: 2000-11-19 12:10 UTC
From: andrew at mopedog dot com Assigned:
Status: Closed Package: Apache related
PHP Version: 4.0.3pl1 OS: RedHat Linux 7.0
Private report: No CVE-ID: None
 [2000-11-17 17:18 UTC] andrew at mopedog dot com
When PHP is set to process all .html files, certain functions of mod_autoindex fail.  Specifically, my directory indexes no longer display README.html or HEADER.html files.  These are specified by the following directives in my httpd.conf file:

HeaderName HEADER.html
ReadmeName README.html

If I comment out the following line:

  AddType application/x-httpd-php .html

then the normal functionality resumes, with header and readme files prepending and appending properly.  This leaves me with the unfortunate choice of having to deny users the ability to parse PHP within HTML files or removing the very useful ability to generate raw directory indexes with headers and footers.

I'm using Apache 1.3.14 and PHP 4.0.3pl1 with RedHat Linux 7.0 on an i686 box.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-19 12:10 UTC] stas@php.net
From mod_autoindex manual:

Filename is treated as a URI path relative to the one used
to access the directory being indexed, and must resolve to a
document with a major content type of "text" (e.g.,
text/html, text/plain, etc.). This means that filename may
refer to a CGI script if the script's actual file type (as
opposed to its output) is marked as text/html such as with a
directive like:

AddType text/html .cgi


For PHP, this does not hold, so mod_autoindex probably won't
work. This doesn't seem to be a PHP bug.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jul 07 08:05:44 2022 UTC