From: Steinar H. Gunderson Date: Wed, 25 Jul 2007 17:55:35 +0000 (+0200) Subject: Add a redirect for /+tags -> /+tags/. X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=2eb22a8cf072d004c98fbdafaba2d7f1b6801f50;ds=sidebyside Add a redirect for /+tags -> /+tags/. --- 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)