Hi, I want to set the document root for a request to map to the basic auth username. I tried this in a PerlFixupHandler:
sub handler {
my $r = shift;
# We only want to do this once per request.
return DECLINED unless $r->is_initial_req;
# Get the username.
my $user = $r->user or return HTTP_UNAUTHORIZED;
# Return forbidden if the username subdiectory does not exist.
my $doc_root = File::Spec->catdir($r->document_root, $user);
return HTTP_FORBIDDEN unless -d $doc_root;
# Set the document root for the duration of this request and return.
$r->document_root($doc_root);
return DECLINED;
}
But alas, it still serves the original document root. How can I get it to
change the document root on a per-request basis? If I cant, should I change the
URI or the filename, instead?
Thnks,
David
smime.p7s
Description: S/MIME cryptographic signature
