Manual:$wgNoFollowLinks

This page is a translated version of the page Manual:$wgNoFollowLinks and the translation is 75% complete.
Parser: $wgNoFollowLinks
Indien true, krijgen externe URL-links in wiki-tekst het attribuut rel="nofollow".
Geïntroduceerd in versie:1.4.0 (r7174)
Verwijderd in versie:nog steeds in gebruik
Toegelaten waardes:(boolean)
Standaardwaarde:true

Details

Als het waar is, krijgen externe URL-links in wiki-tekst het attribuut rel="nofollow" als een hint naar zoekmachines dat ze niet moeten worden gevolgd voor de rangschikking, omdat ze door de gebruiker worden aangeleverd en dus onderhevig zijn aan spamming. Standaard is dit true.

Instellen 'nofollow' voor niet bestaande links

It may be desirable to configure MW to append rel="nofollow" to internal links that point to pages that haven't yet been written (so-called "red links") for various reasons that include avoiding unnecessary crawler traffic to non-extant pages or for the possibility of improved SEO by avoiding punitive action against a site's ranking due to the presence of "broken links" that aren't broken, just not yet authored.

This may be accomplished by using the HtmlPageLinkRendererEnd hook as follows:

// Add rel="nofollow" to links to pages that don't exist (redlinks)
$wgHooks['HtmlPageLinkRendererEnd'][] = 'noFollowRedLinks';
function noFollowRedLinks(
    $linkRenderer, $target, $isKnown, &$text, &$attribs, &$ret)
{
    if (!$isKnown && preg_match('/\bnew\b/S', $attribs['class'] ?? "")) {
        $attribs['rel'] = 'nofollow';
    }
    return true;
}

Zie ook