Revision [6019]
This is an old revision of RobotFriendly made by DotMG on 2005-02-16 06:56:56.
To start, you probably want to add deleted pages to the list of pages which get the robots meta tag. You can use this patch:
diff -ur wiki.orig/actions/header.php wiki/actions/header.php
--- wiki.orig/actions/header.php Tue Feb 15 21:47:56 2005
+++ wiki/actions/header.php Tue Feb 15 21:51:43 2005
@@ -9,7 +9,7 @@
<head>
<title><?php echo $this->GetWakkaName().": ".$this->PageTitle(); ?></title>
<base href="<?php echo $site_base ?>" />
- <?php if ($this->GetMethod() != 'show' || $this->page["latest"] == 'N' || $this->page["tag"] == 'SandBox') echo "<meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n"; ?>
+ <?php if ($this->GetMethod() != 'show' || !$this->page || $this->page["latest"] == 'N' || $this->page["tag"] == 'SandBox') echo "<meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n"; ?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="<?php echo $this->GetConfigValue("meta_keywords") ?>" />
<meta name="description" content="<?php echo $this->GetConfigValue("meta_description") ?>" />
--- wiki.orig/actions/header.php Tue Feb 15 21:47:56 2005
+++ wiki/actions/header.php Tue Feb 15 21:51:43 2005
@@ -9,7 +9,7 @@
<head>
<title><?php echo $this->GetWakkaName().": ".$this->PageTitle(); ?></title>
<base href="<?php echo $site_base ?>" />
- <?php if ($this->GetMethod() != 'show' || $this->page["latest"] == 'N' || $this->page["tag"] == 'SandBox') echo "<meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n"; ?>
+ <?php if ($this->GetMethod() != 'show' || !$this->page || $this->page["latest"] == 'N' || $this->page["tag"] == 'SandBox') echo "<meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n"; ?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="<?php echo $this->GetConfigValue("meta_keywords") ?>" />
<meta name="description" content="<?php echo $this->GetConfigValue("meta_description") ?>" />
To install a patch, place it in a file in your wiki's directory and execute: patch -p1 < filename
Sending 404 response to an unexisting page
Modify ./handlers/page/show.php like this :if (!$this->page) { $httpversion = '1.1'; #TODO : determine HTTP version dynamically. header("HTTP/$httpversion 404 Not Found"); print("<p>This page doesn't exist yet. Maybe you want to <a href=\"".$this->Href("edit")."\">create</a> it?</p></div>"); }
--DotMG