[Slashdotjp-dev 1272] [800] move /code.shtml and /about.shtml to /code and /about

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
2008年 10月 23日 (木) 20:52:44 JST


Revision: 800
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=800
Author:   tach
Date:     2008-10-23 20:52:44 +0900 (Thu, 23 Oct 2008)

Log Message:
-----------
move /code.shtml and /about.shtml to /code and /about

Modified Paths:
--------------
    slashjp/branches/2.5.0.192/Slash/Apache/Apache.pm


-------------- next part --------------
Modified: slashjp/branches/2.5.0.192/Slash/Apache/Apache.pm
===================================================================
--- slashjp/branches/2.5.0.192/Slash/Apache/Apache.pm	2008-10-23 07:57:34 UTC (rev 799)
+++ slashjp/branches/2.5.0.192/Slash/Apache/Apache.pm	2008-10-23 11:52:44 UTC (rev 800)
@@ -519,6 +519,32 @@
 		}
 	}
 
+	# some static contents for slashdot.jp
+	if ($uri =~ m!^/(about|code)(/|\.shtml)?$!x) {
+		my ($word, $sl) = ($1, $2);
+		my @args = ();
+		my $fpath = "/$constants->{sfjp_wikicontents_path}/$word.shtml";
+		my $file = "$constants->{basedir}$fpath";
+		if ($sl) {
+			redirect("$constants->{absolutedir}/$word", 301);
+			return;
+		}
+		unless (-r $file) {
+			return NOT_FOUND;
+		}
+		if ($is_user) {
+			push @args, "name=$word";
+			$r->args(join('&', @args));
+			$r->uri('/wikicontents.pl');
+			$r->filename($constants->{basedir} . '/wikicontents.pl');
+			return OK;
+		} else {
+			$r->uri($fpath);
+			$r->filename($file);
+			return OK;
+		}
+	}
+
 	# faq for slashdot.jp
 	if ($uri =~ m!^/faq (?: (/[^?]*) | /? ) (?: \?(.*) )? $!x) {
 		my($word, $query) = ($1, $2);


Slashdotjp-dev メーリングリストの案内
Zurück zum Archiv-Index