I define a generalized output filter for any .page file:

<FilesMatch "\.page">
     SetHandler              perl-script
     PerlOutputFilterHandler Layout
</FilesMatch>

I have a <Directory> block:

<Directory ${WEB_07_ROOT}/tools>
     DataSources     Environment
</Directory>

which I'm referencing via an Alias from a VirtualHost:

<VirtualHost *:${WEB_07_PORT}>
     ServerName      home.Dimension.org
     DocumentRoot    ${WEB_07_ROOT}/dimension
     DirectoryIndex  index.page

     Alias           /tools ${WEB_07_ROOT}/tools

     <FilesMatch "\.page">
         SetHandler              perl-script
         PerlResponseHandler     Data
     </FilesMatch>
</VirtualHost>

(never mind the macro expansion strings, I'm pre-processing the
configuration file because it's just easier that way).

My PerlResponseHandler works fine on files in the /tools directory for
pages that are specified, for example:

/tools/environment.page
/tools/index.page

If I use just the directory URI:

/tools/

the DirectoryIndex specification works but I don't get any configuration
data inside the PerlResponseHandler from any variant of
Apache2::Module::get_config.  So my response handler doesn't work right.
  Everything's fine when I specify index.page, and when I don't the URI
comes back as index.page, but in the case where DirectoryIndex makes
this happen I don't get any configuration data item.

I have constructed a PerlTransHandler which can be attached to the
VirtualHost.  In it I do what DirectoryIndex would do, I check for a
trailing slash and append index.page.  When I do this the subsequent
response handler has appropriate configuration data.

I find this odd.  Can anyone explain why DirectoryIndex doesn't work the
same as an "equivalent" PerlTransHandler?

Reply via email to