Revision [6064]

This is an old revision of RobotFriendly made by BarkerJr on 2005-02-16 23:01:14.

 

To prevent web SearchEngines' spiders from crawling non-content pages, most of WikkaWiki's WikiEdit, PageHistoryInfo, etcetera pages include robots meta tags to prevent the spiders from indexing them. This keeps the databases of the SearchEngines cleaner, at least for your website. This page aims to help make your website more friendly to robots.

To start, you probably don’t want deleted pages to show up in the SearchEngines’ indices. There are a few ways to do this.


Robots Meta Tag

Contributed by BarkerJr
This patch adds the robots meta tag to the header of deleted pages. This works good, but some SearchEngines don’t support it, and will still show up in some indexes. Sending 404 (see below) works on all SearchEngines, but can sometimes display incorrectly due to a “feature” in Internet Explorer (see the note below it).

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") ?>" />

To install a patch, place it in a file in your wiki's directory and execute: patch -p1 < filename


Sending 404 Not Found

Contributed by DotMG
Modify ./handlers/page/show.php like this :

  1. if (!$this->page)
  2.     {
  3.         $httpversion = isset($_SERVER["SERVER_PROTOCOL"]) ? $_SERVER["SERVER_PROTOCOL"] : 'HTTP/1.1';
  4.         header("$httpversion 404 Not Found");
  5.         print("<p>This page doesn't exist yet. Maybe you want to <a href=\"".$this->Href("edit")."\">create</a> it?</p></div>");
  6.     }

Note: On IE, there is a number of bytes required, and if the length of body is less than this limit, IE displays its own default content. But normally, the page should always display the content we expect (This page doesn't exist. Maybe you want to create it).
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki