cvs: phpweb / error.php /include errors.inc

From: Date: Sat, 14 Aug 2004 15:02:46 +0000
Subject: cvs: phpweb / error.php /include errors.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-25804@lists.php.net to get a copy of this message
goba Sat Aug 14 11:02:46 2004 EDT Modified files: /phpweb error.php /phpweb/include errors.inc Log: add BC handling for old install part (modified patch by Nuno) http://cvs.php.net/diff.php/phpweb/error.php?r1=1.23&r2=1.24&ty=u Index: phpweb/error.php diff -u phpweb/error.php:1.23 phpweb/error.php:1.24 --- phpweb/error.php:1.23 Mon Jul 26 14:08:39 2004 +++ phpweb/error.php Sat Aug 14 11:02:46 2004 @@ -1,6 +1,6 @@ <?php -// $Id: error.php,v 1.23 2004/07/26 18:08:39 goba Exp $ +// $Id: error.php,v 1.24 2004/08/14 15:02:46 goba Exp $ /* @@ -152,6 +152,43 @@ $URI = strtolower($URI); // ============================================================================ +// Major manual page modifications (need to handle shortcuts and pages in all languages) +// Used permanent HTTP redirects, so search engines will be able to pick up the correct +// new URLs for these pages. +$manual_page_moves = array( + // entry point changed + 'installation' => 'install', + + // was splitted among platforms (don't know where to redirect) + 'install.apache' => 'install', + 'install.apache2' => 'install', + 'install.netscape-enterprise'=> 'install', + 'install.otherhttpd' => 'install', + + // moved to platform sections + 'install.caudium' => 'install.unix.caudium', + 'install.commandline' => 'install.unix.commandline', + 'install.fhttpd' => 'install.unix.fhttpd', + 'install.hpux' => 'install.unix.hpux', + 'install.iis' => 'install.windows.iis', + 'install.linux' => 'install.unix', + 'install.omnihttpd' => 'install.windows.omnihttpd', + 'install.openbsd' => 'install.unix.openbsd', + 'install.sambar' => 'install.windows.sambar', + 'install.solaris' => 'install.unix.solaris', + 'install.xitami' => 'install.windows.xitami', +); + +if (isset($manual_page_moves[$URI])) { + status_header(301); + mirror_redirect("/" . $manual_page_moves[$URI]); +} elseif (preg_match("!^manual/([^/]+)/([^/]+).php$!", $URI, $match) && + isset($manual_page_moves[$match[2]])) { + status_header(301); + mirror_redirect("/manual/$match[1]/" . $manual_page_moves[$match[2]] . ".php"); +} + +// ============================================================================ // Define shortcuts for PHP files, manual pages and external redirects $uri_aliases = array ( @@ -172,8 +209,6 @@ # manual shortcuts "ini" => "configuration", - "install" => "installation", - "intro" => "introduction", "whatis" => "introduction", "whatisphp" => "introduction", @@ -197,7 +232,7 @@ "icap" => "mcal", // mcal is the successor of icap - "news.php" => "news-2003", // BC + "news.php" => "news-2004", // BC "readme.mirror" => "mirroring", // BC "zend_changes.txt" => "zend-engine-2", // BC "zend2_example.phps" => "zend-engine-2", // BC http://cvs.php.net/diff.php/phpweb/include/errors.inc?r1=1.4&r2=1.5&ty=u Index: phpweb/include/errors.inc diff -u phpweb/include/errors.inc:1.4 phpweb/include/errors.inc:1.5 --- phpweb/include/errors.inc:1.4 Wed Jun 9 09:19:57 2004 +++ phpweb/include/errors.inc Sat Aug 14 11:02:46 2004 @@ -1,5 +1,5 @@ <?php -// $Id: errors.inc,v 1.4 2004/06/09 13:19:57 goba Exp $ +// $Id: errors.inc,v 1.5 2004/08/14 15:02:46 goba Exp $ /* This script provides functions to print out @@ -56,8 +56,9 @@ { // Set status text switch ($num) { - case 404: $status = "Not Found"; break; case 200: $status = "OK"; break; + case 301: $status = "Moved Permanently"; break; + case 404: $status = "Not Found"; break; default: return FALSE; }

« previous php.mirrors (#25804) next »