With this in Wikiacademia::WebApp sub access_allowed { my $r = shift; return 0 if $r->uri =~ m/_forbidden_$/; return 1; } then this _forbidden_.txt file gives a "Forbidden" screen when visited.