httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 47184] New: Feature request: DirectoryHandler
Date Mon, 11 May 2009 15:18:42 GMT

           Summary: Feature request: DirectoryHandler
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: mod_dir

An awful lot of RewriteRules are written to perform an action that might be
better done with a new directive: DirectoryHandler DirectoryHandler would cause
all (unhandled) requests directed at a particular directory to be handled by a
particular URI or file.

For example:

DirectoryHandler index.php

would replace

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [PT]

This would replace the rewriterule set that comes with virtually every PHP
application out there which maps all requests to an index.php file that
examines the requested URI and does something with it.

Note that this behavior can be half-way simulated using a ErrorDocument 404
directive, but ErrorDocument discards POST data, and so doesn't really do what
we want.

DirectoryHandler could optionally have a flag of some kind that enables or
disables the action performed by those two RewriteCond directives - that is, by
default, DirectoryHandler would catch requests that didn't map to a valid
resource, but perhaps there are cases where you want it to map to that handler
regardless of the presence or absence of files in that location.

There's no urgency on this, it's just a long-standing pet peeve of mine that
I'd like to see handled in 2.4

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message