|
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 | |
|---|
| 8 | package redir; |
|---|
| 9 | |
|---|
| 10 | use strict; |
|---|
| 11 | use warnings; |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | # --- Configurable variables ----------- |
|---|
| 15 | |
|---|
| 16 | # no configure |
|---|
| 17 | |
|---|
| 18 | # --- Plug-in package variables -------- |
|---|
| 19 | |
|---|
| 20 | # -------------------------------------- |
|---|
| 21 | |
|---|
| 22 | use CGI qw/:standard :netscape/; |
|---|
| 23 | |
|---|
| 24 | sub start { |
|---|
| 25 | if ($blosxom::path_info) { |
|---|
| 26 | return 0; |
|---|
| 27 | }; |
|---|
| 28 | 1; |
|---|
| 29 | } |
|---|
| 30 | |
|---|
| 31 | sub 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 | |
|---|
| 43 | 1; |
|---|
| 44 | |
|---|
| 45 | __END__ |
|---|
| 46 | |
|---|
| 47 | =head1 NAME |
|---|
| 48 | |
|---|
| 49 | Blosxom Plugin: redir |
|---|
| 50 | |
|---|
| 51 | =head1 SYNOPSIS |
|---|
| 52 | |
|---|
| 53 | Date base URI integration. |
|---|
| 54 | |
|---|
| 55 | =head1 AUTHOR |
|---|
| 56 | |
|---|
| 57 | cho45 <cho45@lowreal.net>, http://lowreal.net/ |
|---|
| 58 | |
|---|
| 59 | =head1 DESCRIPTION |
|---|
| 60 | |
|---|
| 61 | This plugins redirect the URLs like /2006, /2006/09 or /2006/09/01 |
|---|
| 62 | to /2006/, /2006/09/, /2006/09/01/ each. |
|---|
| 63 | |
|---|
| 64 | =head1 SEE ALSO |
|---|
| 65 | |
|---|
| 66 | Blosxom Home/Docs/Licensing: http://www.blosxom.com/ |
|---|
| 67 | all about blosxom (lang=ja): http://blosxom.info/ |
|---|
| 68 | |
|---|
| 69 | =head1 LICENSE |
|---|
| 70 | |
|---|
| 71 | section Blosxom plugin Copyright 2006 cho45 |
|---|
| 72 | |
|---|
| 73 | This plugin is licensed under Creative-Commons by 2.1 jp. |
|---|
| 74 | |
|---|
| 75 | See the below URL: |
|---|
| 76 | http://creativecommons.org/licenses/by/2.1/jp/ |
|---|
| 77 | |
|---|