How does one pass information between handlers via an internal redirect?
I am creating a virtual set of documents with a path of the form
/text/actual_path. The idea is that I do an internal redirect to serve
the real file (at /actual_path) but use the fact that a "/text/" url was
requested to set a flag to render that file in a text browser friendly
form. I've tried notes and subprocess_env (see below) but they don't
appear to work across an internal redirect. I don't think I can use
cookies for this and would prefer not to munge the redirected url (since
this causes problems with our local web cache). Any advice would be much
appreciated.
I have the following (non-functional) code so far
# Silently redirect text-only requests
my $uri = $r->parsed_uri;
if ($uri->path =~ /^\/text(\/.*)$/) {
$uri->path($1);
# Try and pass a flag
$r->notes('view' => 'text');
$r->subprocess_env('view' => 'text');
$r->internal_redirect($uri->unparse);
return OK;
} else {
# See if flag has been set
my $notes = $r->notes;
$view = $notes->{'view'}; # is always undef
$view = $r->subprocess_env('view'); # is also always undef
}
I am using mod_perl 1.24 and Apache 1.3.12 on FreeBSD 4.0-Stable.
--
Jose Marques