[Pmwiki-users] robots
Christian Ridderström
chr
Thu Jan 8 18:15:38 CST 2004
On 9 Jan 2004, John Rankin wrote:
> A very helpful tip!
>
> Are there any cases where one *doesn't* want this behaviour?
>
> If not, I'd like to see the code added to PmWiki itself.
Another solution is to use meta tags
http://www.pmichaud.com/wiki/Cookbook/MetaTag
so the code below should probably be introduced like this into pmwiki.php:
#
# Taking care of robots unless we have $DisableAutoRobots = 1
#
if(!isset($DisableAutoRobots) || !$DisableAutoRobots) {
if($action and $action!='browse')
$robots="noindex,nofollow";
else
$robots="index,follow";
$HTMLTitleFmt = array ("<title>\$Titlespaced</title>",
"<META CONTENT=\"$robots\" NAME=\"robots\">");
}
where I wrote '$DisableAutoRobots' rather than '$EnableAutoRobots' since I
think you'd like this function enabled by default.
/Christian
PS. The code above isn't tested, so watch out...
> On Friday, 9 January 2004 6:43 AM, Christian Ridderstr?m <chr at home.se> wrote:
> On Thu, 8 Jan 2004, bram brambring (zonnet) wrote:
>
> > Hi,
> >
> >
> > I have been looking into:
> >
> > http://www.pmichaud.com/wiki/PmWiki/Robots
> >
> > and used the depicted rules to exclude the action and search links. However
> > some searchengine sites still showed up with the ?action links.
> >
> > I talked to the owner of one of them, he pointed me to the fact that
> > wildcards are not part of the robot exclusion standaard. And although google
> > supports wildcards, he is right.
> >
> > The disallow section must be a complete path starting with '/'
> >
> > I solved it in the local.php, are there nicer solutions?
> >
> > if ( $action and ( $action!='browse' ) ) {
> > $robots="noindex,nofollow";
> > } else {
> > $robots="index,follow";
> > }
> >
> > $HTMLTitleFmt = array (
> > "<title>\$Titlespaced</title>",
> > "<META CONTENT=\"$robots\" NAME=\"robots\">");
> >
>
> Thanks for the tip! (I reformatted it like this and it seems to work)
> #
> # Taking care of robots...
> #
> if($action and $action!='browse')
> $robots="noindex,nofollow";
> else
> $robots="index,follow";
> $HTMLTitleFmt = array ("<title>\$Titlespaced</title>",
> "<META CONTENT=\"$robots\" NAME=\"robots\">");
>
> I'd also noticed in the documentation of robots.txt that wildcards aren't
> allowed, but forgotten about the whole thing.
>
> /Christian
>
> >
> > _______________________________________________
> > Pmwiki-users mailing list
> > Pmwiki-users at pmichaud.com
> > http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
> >
>
>
--
Dr. Christian Ridderstr?m, +46-8-768 39 44 http://www.md.kth.se/~chr
More information about the pmwiki-users
mailing list