cvs: phpweb /error index.php

From: Date: Wed, 16 May 2001 14:37:12 +0000
Subject: cvs: phpweb /error index.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-5004@lists.php.net to get a copy of this message
cmv Wed May 16 07:37:12 2001 EDT Modified files: /phpweb/error index.php Log: tweak Index: phpweb/error/index.php diff -u phpweb/error/index.php:1.25 phpweb/error/index.php:1.26 --- phpweb/error/index.php:1.25 Sun May 13 15:38:06 2001 +++ phpweb/error/index.php Wed May 16 07:37:12 2001 @@ -1,12 +1,23 @@ <?php require_once 'prepend.inc'; + +function make404() { + global $REQUEST_URI; + header('HTTP/1.0 404 Not Found'); + commonHeader('404 Not Found'); + echo "<H1>Not Found</H1>\n"; + echo "<P>The page <B>" . $REQUEST_URI . "</B> could not be found.</P>\n"; + commonFooter(); +} + + if (file_exists("../configuration.inc")) { include_once "../configuration.inc"; } if (preg_match('/\.(pdf|gif|jpg)$/', $REQUEST_URI)) { - print "404 Not found"; + make404(); exit; } @@ -50,6 +61,7 @@ $uri=substr($REDIRECT_REDIRECT_ERROR_NOTES,strpos($REDIRECT_REDIRECT_ERROR_NOTES,$DOCUMENT_ROOT)+strlen($DOCUMENT_ROOT)+1); + # try to find the uri as a manual entry require "manual-lookup.inc"; @@ -71,10 +83,16 @@ } -# If all else fails ... redirect to the search page with the pattern set to $uri +# If all else fails ... redirect to the search page with the pattern set to $REQUEST_URI -header('HTTP/1.0 302 Redirect'); -header('Location: /search.php?show=nosource&pattern='.urlencode($uri) ); +if ($REQUEST_URI) { + header('HTTP/1.0 302 Redirect'); + header('Location: /search.php?show=nosource&pattern='.urlencode($REQUEST_URI) ); + exit; +} + +make404(); exit; + ?>

« previous php.mirrors (#5004) next »