Prevent indexing of pages with multiple months of the content, any
authorshort <>
Fri, 21 Jun 2002 16:26:25 +0000 (16:26 +0000)
committershort <>
Fri, 21 Jun 2002 16:26:25 +0000 (16:26 +0000)
websearch robot should get indexed the right one specific page anyway.
 - "meta-robots-noindex" used as 'robots.txt' is not capable of QUERY_STRING

common.php
obsah.php

index 8a7b6ed..34f3ec6 100644 (file)
@@ -67,7 +67,7 @@ function fatal($msg="UNKNOWN")
 {
        global $admin_mail;
 
-       heading(false/*title*/); // it is always safe
+       heading(false/*title*/,false/*indexme*/); // notitle is always safe, don't index the error message
        print("\n<p>&nbsp;<br />&nbsp;</p><hr /><h1 class=\"error\">Nastala chyba pøi zpracování: $msg!</h1>\n"
                        ."<p>Mù¾ete tento problém nahlásit <a href=\"mailto:$admin_mail\">správci tohoto webu</a>.</p>\n");
        footer();
@@ -710,7 +710,7 @@ function no_cache()
        header("Pragma: no-cache");                                // HTTP/1.0
 }
 
-function heading($title=true)
+function heading($title=true,$indexme=true)
 {
        global $msie_major,$mozilla_major,$title_tail,$head_css,$have_css,$head,$heading_done,$title_prefix,$force_charset;
 
@@ -755,6 +755,7 @@ h1,h2    { color: yellow; background-color: transparent; }
                        print(trim($head_css)."\n");
                print("--></style>\n");
                }
+       print('<meta name="robots" content="'.($indexme ? "" : "no" ).'index,follow" />'."\n");
        if (isset($head))
                print($head);
        print("</head><body");
index 1213d27..eb262e1 100644 (file)
--- a/obsah.php
+++ b/obsah.php
        $head_css="
 .page { font-style: italic; }
 ";
-       heading();
+
+       // Prevent indexing of pages with multiple months of the content, any
+       // websearch robot should get indexed the right one specific page anyway.
+       heading(true/*title*/,($year && $month)/*indexme*/);
+
        print("<h1>$title_tail</h1>\n");
 
        $result=db_query("select year,month,month_last,contents from $tb_obsah"