Thanks to Geoff Young for pointing me in the right direction towards
Apache::SimpleReplace. I have made my own stripped down version of this,
but still need guidance (Geoff, you're welcome to reply again if you can
help ;) Since I only want all text/html pages to be appended to, I want all
other types to be sent asis. Here's what I'm doing now:
in conf:
<Location />
SetHandler perl-script
PerlHandler AddData
</Location>
in lib/perl/AddData.pm:
sub handler {
my $r = shift;
$log = $r->server->log;
log_info("Opening ". $r->filename . " w/ type of " .
$r->content_type);
$rqh = Apache::File->new($r->filename)
|| return SERVER_ERROR;
$r->send_http_header();
$r->send_fd($rqh);
if ($r->content_type eq "text/html") { # it's HTML
log_info("Appending extra data ");
$r->print("testing");
}
return OK;
}
This works fine for specified html pages. However, when a DirectoryIndex
page is called indirectly (http://www.foobar.com/ for instance), an item of
type httpd/unix-directory gets printed. So, I guess I'm asking 'in what
stage does the DirectoryIndex get called, and why is it being ignored in
this case?'
Jim
[EMAIL PROTECTED]