summaryrefslogtreecommitdiff
path: root/index.cgi
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2013-03-08 15:44:26 +0000
committerDimitri Sokolyuk <demon@dim13.org>2013-03-08 15:44:26 +0000
commita7a6c8c1d0830a0838c735b136a9ba867c6de4f8 (patch)
tree481bdc3ebfddb3a1e3c4c9eb51176b2c7965adf2 /index.cgi
parent72a436f5866cf02defaad890523d214a94fc185c (diff)
fix 404
Diffstat (limited to 'index.cgi')
-rwxr-xr-xindex.cgi7
1 files changed, 5 insertions, 2 deletions
diff --git a/index.cgi b/index.cgi
index 6241434..e9e2c55 100755
--- a/index.cgi
+++ b/index.cgi
@@ -70,7 +70,7 @@ my $path = $cgi->path_info();
my $output = \&output_article;
my @args;
-if ( $path =~ /^\/(\d{4})\/(\d{2})\/([^\/]+)$/ ) {
+if ( $path =~ m/^\/(\d{4})\/(\d{2})\/([^\/]+)$/ ) {
@args = ( year => $1, month => $2, uri => $3 );
} elsif ( $path =~ m/^\/(\d{4})\/(\d{2})\/?$/ ) {
@args = ( year => $1, month => $2 );
@@ -84,6 +84,8 @@ if ( $path =~ /^\/(\d{4})\/(\d{2})\/([^\/]+)$/ ) {
$output = \&output_rss;
} elsif ( $path =~ m/^\/sitemap\.xml$/ ) {
$output = \&output_sitemap;
+} elsif ( $path ) {
+ @args = ( error => 1 );
}
$cgi->charset('UTF-8');
@@ -113,7 +115,8 @@ sub output_article {
$template->param( copyright => $blog_rights );
$template->param( google_analytics_id => $google_analytics_id );
$template->param( google_webmaster_id => $google_webmaster_id );
- if (@{$articles}) {
+
+ if (@{$articles} && !$args{'error'}) {
$template->param( articles => $articles );
if ($comments_allowed && $args{'uri'}) {
$template->param( comment_form => 1 );