# not <Directory> directive
sub prepare_path {
my $c = shift;
-
+
{
my $path = $c->apache->uri;
$path =~ s/^\///;
- if ( my $filename = $c->apache->filename ) {
+ if ( $c->apache->filename && -e $c->apache->filename ) {
- $filename = ( File::Spec->splitpath($filename) )[2];
+ my $filename = ( File::Spec->splitpath( $c->apache->filename ) )[2];
if ( index( $path, $filename ) == 0 ) {
$path = substr( $path, length($filename) );
my $host = $c->apache->hostname;
my $port = $c->apache->get_server_port;
my $path = $c->apache->uri;
-
+
if ( length( $c->request->path ) ) {
$path =~ s/\/$//;
$path = substr( $path, 0, length($path) - length($c->req->path) );
$base->host($host);
$base->port($port);
$base->path($path);
-
+
$c->request->base( $base->canonical->as_string );
}
}