cvs: phpweb / error.php
| From: | Gabor Hojtsy | Date: | Sat, 06 Sep 2003 08:51:10 +0000 |
| Subject: | cvs: phpweb / error.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-20812@lists.php.net to get a copy of this message | ||
goba Sat Sep 6 04:51:10 2003 EDT
Modified files:
/phpweb error.php
Log:
Better 404 page for manual pages (which are not to be
searched in the function list or in Google, as they are
clearly missing files on the server). Do preserve the 404
error code on the pages though, as these are not to be
indexed (also add a meta for this reason).
Index: phpweb/error.php
diff -u phpweb/error.php:1.8 phpweb/error.php:1.9
--- phpweb/error.php:1.8 Thu Aug 21 07:25:13 2003
+++ phpweb/error.php Sat Sep 6 04:51:10 2003
@@ -1,6 +1,6 @@
<?php
-// $Id: error.php,v 1.8 2003/08/21 11:25:13 goba Exp $
+// $Id: error.php,v 1.9 2003/09/06 08:51:10 goba Exp $
/*
@@ -232,6 +232,12 @@
}
// ============================================================================
+// 404 page for manual pages (eg. not built language)
+if (strpos($URI, "manual/") === 0) {
+ manual404();
+}
+
+// ============================================================================
// If no match was found till this point, the last action is to start a
// search with the URI the user typed in
$fallback = (myphpnet_urlsearch() === MYPHPNET_URL_MANUAL ? "manual" :
"quickref");
@@ -245,10 +251,26 @@
{
global $_SERVER;
status_header(404);
- site_header('404 Not Found');
+ site_header('404 Not Found', array("noindex"));
echo "<h1>Not Found</h1>\n" .
"<p><strong>" . htmlspecialchars($_SERVER['REQUEST_URI'])
.
"</strong> not found on this server.</p>\n";
+ site_footer();
+ exit;
+}
+
+// A 'good looking' 404 error message page for manual pages
+function manual404()
+{
+ global $_SERVER;
+ status_header(404);
+ site_header('404 Not Found', array("noindex"));
+ echo "<h1>Not Found</h1>\n" .
+ "<p>The manual page you are looking for (<strong>" .
+ htmlspecialchars($_SERVER['REQUEST_URI']) .
+ "</strong>) is not available on this server right now. " .
+ "Please check back later, or if the problem persist, " .
+ "<a href=\"/copyright.php#contact\">contact the
webmasters</a>.</p>\n";
site_footer();
exit;
}