# Pastebin WHgOl1g4 diff --git a/app.pl b/app.pl --- a/app.pl +++ b/app.pl @@ -8,6 +8,9 @@ get '(*dir)/:file' => sub { my $self = shift; my $dir = $self->param('dir'); my $file = $self->param('file'); + unless (-f "html/$dir/$file.html") { + return $self->render(template => 'does_not_exist'); + } return $self->redirect_to("/$dir/$file.html"); };