Skip to content

Commit

Permalink
Merge pull request #827 from splitbrain/canonical-root
Browse files Browse the repository at this point in the history
Set canonical URL to root when on start page
  • Loading branch information
selfthinker committed Aug 3, 2014
2 parents 75112fc + 01f9be5 commit 1f3d447
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inc/template.php
Expand Up @@ -369,7 +369,11 @@ function tpl_metaheaders($alt = true) {
} else {
$head['meta'][] = array('name'=> 'robots', 'content'=> 'noindex,nofollow');
}
$head['link'][] = array('rel'=> 'canonical', 'href'=> wl($ID, '', true, '&'));
$canonicalUrl = wl($ID, '', true, '&');
if ($ID == $conf['start']) {
$canonicalUrl = DOKU_URL;
}
$head['link'][] = array('rel'=> 'canonical', 'href'=> $canonicalUrl);
} else {
$head['meta'][] = array('name'=> 'robots', 'content'=> 'noindex,follow');
}
Expand Down

0 comments on commit 1f3d447

Please sign in to comment.