Add a redirect for /+tags -> /+tags/.
authorSteinar H. Gunderson <sesse@debian.org>
Wed, 25 Jul 2007 17:55:35 +0000 (19:55 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Wed, 25 Jul 2007 17:55:35 +0000 (19:55 +0200)
perl/Sesse/pr0n/Listing.pm

index f97a643414677f9ad177a3b5ab0f44ce1586684e..d344083a0518225fcbaf36c8ce4430b0cc89577b 100644 (file)
@@ -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)