X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=doc%2Fdirplex.doc;h=d41c1add31eb99fa509e479e87f76d1131855da6;hb=472abd3cd62e50a4e9d2bfc5368547e6325ed31b;hp=9d4583d7e1f80901ca9d728d87707852b233e80f;hpb=e7e3e59303097e0021571883b8bcdd38c4432395;p=ashd.git diff --git a/doc/dirplex.doc b/doc/dirplex.doc index 9d4583d..d41c1ad 100644 --- a/doc/dirplex.doc +++ b/doc/dirplex.doc @@ -29,7 +29,7 @@ OPTIONS *-h*:: - Display a brief help message to standard output and exit. + Print a brief help message to standard output and exit. *-N*:: @@ -55,11 +55,10 @@ being examined is considered the result of the mapping. Otherwise, any escape sequences in the path element under consideration are unescaped before examining it. -Any path element that begins with a dot is considered invalid and -results in a 404 response to the client. If the path element names a -directory in the current directory, the procedure continues in that -directory. If it names a file, that file is considered the result of -the mapping (even if the rest string has not been exhausted yet). +If the path element names a directory in the current directory, the +procedure continues in that directory. If it names a file, that file +is considered the result of the mapping (even if the rest string has +not been exhausted yet). If the path element does not name anything in the directory under consideration, but contains no dots, then the directory is searched @@ -75,6 +74,8 @@ index file name contains no dots and there is no exact match, then, again, the directory is searched for a file whose name before the first dot matches the index file name. +See also 404 RESPONSES below. + CONFIGURATION ------------- @@ -153,7 +154,7 @@ The follow configuration directives are recognized: Declares a named, transient request handler (see *ashd*(7) for a more detailed description of persistent handlers). It must - contains exactly one follow-up line, *exec* 'PROGRAM' + contain exactly one follow-up line, *exec* 'PROGRAM' ['ARGS'...], specifying the program to execute and the arguments to pass it. In addition to the specified arguments, the HTTP method, raw URL and the rest string will be appended @@ -219,6 +220,12 @@ The following rules are recognized: Matches if and only if no *match* stanza without a *default* rule has matched. +*local*:: + + Valid only in `.htrc` files, *local* matches if and only if + the file under consideration resides in the same directory as + the containing `.htrc` file. + In addition to the rules, a *match* stanza must contain exactly one follow-up line specifying the action to take if it matches. The following actions are recognized: @@ -239,8 +246,29 @@ following actions are recognized: by a *fchild* stanza. This action exists mostly for convenience. -If no *match* stanza matches, a 404 response is returned to the -client. +404 RESPONSES +------------- + +Any of the following cases will result in a 404 response being sent to +the client. + + * Failure of the mapping procedure to find a matching physical file. + * Presence of a path element during mapping that begins with a dot. + * A path element which, after URL unescaping, contains slashes. + * The mapping procedure finding a file which is neither a directory + nor a regular file. + * Presence of a non-final but empty path element during mapping. + * A physical file having been found which is not being matched by any + *match* stanza. + +*dirplex* will send a built-in 404 response by default, but any +`.htrc` file or global configuration may define a request handler +named `.notfound` to customize the behavior. Note that, unlike +successful requests, such a handler will not be passed the +`X-Ash-File` header. + +The built-in `.notfound` handler can also be used in *match* or +*capture* stanzas. EXAMPLES --------