root/lang/perl/blosxom/plugins/redir

Revision 77, 1.3 kB (checked in by cho45, 4 years ago)

lang/perl/blosxom,
lang/perl/blosxom/plugins:

Added for blosxom plugins.

  • Property svn:keywords set to Revision
Line 
1# Blosxom Plugin: redir
2# Author(s): cho45 <cho45@lowreal.net>
3# Version: 128 + $Revision$
4# Documentation: Set the bottom of this file or type: perldoc redir
5# vim:set ft=perl:
6
7
8package redir;
9
10use strict;
11use warnings;
12
13
14# --- Configurable variables -----------
15
16# no configure
17
18# --- Plug-in package variables --------
19
20# --------------------------------------
21
22use CGI qw/:standard :netscape/;
23
24sub start {
25        if ($blosxom::path_info) {
26                return 0;
27        };
28        1;
29}
30
31sub skip {
32        my $path_info = path_info();
33
34        if ($path_info =~ m{^/\d{4}(/\d\d(/\d\d)?)?$}) {
35                $blosxom::header->{'Status'} = "303 See Other add slash";
36                $blosxom::header->{'Location'} = $blosxom::url . "$path_info/";
37                return 1;
38        }
39
40        return 0;
41}
42
431;
44
45__END__
46
47=head1 NAME
48
49Blosxom Plugin: redir
50
51=head1 SYNOPSIS
52
53Date base URI integration.
54
55=head1 AUTHOR
56
57cho45 <cho45@lowreal.net>, http://lowreal.net/
58
59=head1 DESCRIPTION
60
61This plugins redirect the URLs like /2006, /2006/09 or /2006/09/01
62to /2006/, /2006/09/, /2006/09/01/ each.
63
64=head1 SEE ALSO
65
66Blosxom Home/Docs/Licensing: http://www.blosxom.com/
67all about blosxom (lang=ja): http://blosxom.info/
68
69=head1 LICENSE
70
71section Blosxom plugin Copyright 2006 cho45
72
73This plugin is licensed under Creative-Commons by 2.1 jp.
74
75See the below URL:
76http://creativecommons.org/licenses/by/2.1/jp/
77
Note: See TracBrowser for help on using the browser.