From 2eb22a8cf072d004c98fbdafaba2d7f1b6801f50 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 25 Jul 2007 19:55:35 +0200 Subject: [PATCH] Add a redirect for /+tags -> /+tags/. --- perl/Sesse/pr0n/Listing.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/perl/Sesse/pr0n/Listing.pm b/perl/Sesse/pr0n/Listing.pm index f97a643..d344083 100644 --- a/perl/Sesse/pr0n/Listing.pm +++ b/perl/Sesse/pr0n/Listing.pm @@ -17,6 +17,12 @@ sub handler { } } + # Fix common error: pr0n.sesse.net/+foo -> pr0n.sesse.net/+foo/ + if ($r->uri !~ /\/$/) { + $r->headers_out->{'location'} = $r->uri . "/"; + return Apache2::Const::REDIRECT; + } + # find the last modification my $ref = $dbh->selectrow_hashref('SELECT EXTRACT(EPOCH FROM last_update) AS last_update FROM events WHERE vhost=? ORDER BY last_update DESC LIMIT 1', undef, $r->get_server_name) -- 2.39.2