[Pmwiki-users] About robots (was Re: Removing sidebar if there's no SideBar-page)

Christian Ridderström chr
Sun Feb 15 09:46:40 CST 2004


On Sun, 15 Feb 2004, Patrick R. Michaud wrote:

> As far as the MyPageExists function--

This is slightly related to MyPageExists. I used to have this code in my
customization:

	// *************************************************************
	// Taking care of robots...                   
	//

	// Return path of page source or empty string if page does not exist
	function PageSource($pagename) {
	  global $WikiLibDirs,$PageFileFmt;
	  $pagefile = FmtPageName($PageFileFmt,$pagename);
	  if (!$pagefile) return "";
	  foreach ($WikiLibDirs as $dir) {
	    if (file_exists("$dir/$pagefile")) return "$dir/$pagefile";
	  }
	  return "";
	}

	// Return true if the source of the page comes fromm wikilib.d
	function IsPageFromWikiLib($pagename) {
	  return !(strpos(PageSource($pagename), "wikilib.d/") === false);
	}

	if(($action and $action!='browse') or IsPageFromWikiLib($pagename))
	  $robots="noindex,nofollow";
	else
	  $robots="index,follow";
	$HTMLTitleFmt = array ("<title>\$Titlespaced</title>",
	                       "<META CONTENT=\"$robots\" NAME=\"robots\">");

where I tell the robots to not index things from the pmwiki distribution
--- the search results should be found at pmichaud.com instead.

Maybe this is something to incorporate as part of the standard 
distribution?

/Christian

-- 
Christian Ridderstr?m                           http://www.md.kth.se/~chr





More information about the pmwiki-users mailing list