cvs: docweb /www redirect.php
| From: | Sean Coates | Date: | Mon, 17 Jan 2005 19:52:27 +0000 |
| Subject: | cvs: docweb /www redirect.php | ||
| Groups: | php.doc.web | ||
| Request: | Send a blank email to doc-web+get-479@lists.php.net to get a copy of this message | ||
sean Mon Jan 17 14:52:27 2005 EDT
Modified files:
/docweb/www redirect.php
Log:
fix 404 url breakage
http://cvs.php.net/diff.php/docweb/www/redirect.php?r1=1.1&r2=1.2&ty=u
Index: docweb/www/redirect.php
diff -u docweb/www/redirect.php:1.1 docweb/www/redirect.php:1.2
--- docweb/www/redirect.php:1.1 Sat Sep 11 19:17:15 2004
+++ docweb/www/redirect.php Mon Jan 17 14:52:26 2005
@@ -15,7 +15,7 @@
+----------------------------------------------------------------------+
| Authors: Sean Coates <sean@php.net> |
+----------------------------------------------------------------------+
-$Id: redirect.php,v 1.1 2004/09/11 23:17:15 sean Exp $
+$Id: redirect.php,v 1.2 2005/01/17 19:52:26 sean Exp $
*/
require_once('../include/lib_proj_lang.inc.php');
@@ -115,8 +115,33 @@
) {
$language = $parts[1];
$uri = implode('/', array_slice($parts, 2));
+} elseif (
+ // /proj/lang/404
+ part_is_project($parts[1]) &&
+ part_is_language($parts[2])
+) {
+ $project = $parts[1];
+ $language = $parts[2];
+} elseif (
+ // /lang/proj/404
+ part_is_language($parts[1]) &&
+ part_is_project($parts[2])
+) {
+ $language = $parts[1];
+ $project = $parts[2];
+} elseif (
+ // /proj/404
+ part_is_project($parts[1])
+) {
+ $project = $parts[1];
+} elseif (
+ // /lang/404
+ part_is_language($parts[1])
+) {
+ $language = $parts[1];
}
+
// we have a valid URI, answer the request
if (isset($uri)) {
header($_SERVER['SERVER_PROTOCOL']." 200 Found (magic redirect)");
@@ -125,6 +150,7 @@
// no resource found:
header($_SERVER['SERVER_PROTOCOL']." 404 Not Found");
$_SERVER["REDIRECT_STATUS"] = '404';
+ $uri = '/';
require('error.php');
}