diff options
author | Moritz Lenz <moritz@faui2k3.org> | 2010-07-18 19:58:35 (GMT) |
---|---|---|
committer | Moritz Lenz <moritz@faui2k3.org> | 2010-07-18 19:58:35 (GMT) |
commit | 5ebea803c7a333b20f0906c00180120cdafb494a (patch) | |
tree | 8ae56eb97ed76aa0bb675794092fffddd31661cc | |
parent | a801de51fa4760f631d1a0d33bc8fce1dbb2032c (diff) |
implement "yesterday" in URLs
-rw-r--r-- | cgi/.htaccess | 3 | ||||
-rwxr-xr-x | cgi/out.pl | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/cgi/.htaccess b/cgi/.htaccess index 089baac..56e94fd 100644 --- a/cgi/.htaccess +++ b/cgi/.htaccess @@ -16,6 +16,9 @@ RewriteRule ^([\w_-]+)/?$ /channel-index.pl?channel=$1 [L] RewriteCond %{HTTP_REQUEST} !^search RewriteRule ^([^/]+)/today$ out.pl?channel=$1 +RewriteCond %{HTTP_REQUEST} !^search +RewriteRule ^([^/]+)/yesterday$ out.pl?channel=$1;date=yesterday + RewriteCond %{QUERY_STRING} ^channel=([^;]+);date=(\d\d\d\d-\d\d-\d\d) RewriteCond %{HTTP_REQUEST} ^out\.pl RewriteRule ^out.pl /%1/%2? [R=301,L] @@ -60,7 +60,10 @@ my $channel = $q->param('channel') || $default_channel; my $date = $q->param('date') || gmt_today(); if ($date eq 'today') { $date = gmt_today(); +} elsif ($date eq 'yesterday') { + $date = date(gmt_today()) - 1; } + if ($date eq gmt_today()) { print http_header({ nocache => 1}); } else { |