From b1af90141d42f8844159ff4fad76968a8ee78687 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Thu, 1 Aug 2013 16:32:28 +0200 Subject: Improve nofollow behaviour for ?do=index In response to FS#2766 - make namespace links in the browser sitemap nofollow - remove nofollow from browser sitemap link on the wiki start page when sitemap.xml generation is disabled --- inc/html.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index 53f4c45ff..53a100ec7 100644 --- a/inc/html.php +++ b/inc/html.php @@ -859,7 +859,8 @@ function html_list_index($item){ $base = ':'.$item['id']; $base = substr($base,strrpos($base,':')+1); if($item['type']=='d'){ - $ret .= ''; + // FS#2766, no need for search bots to follow namespace links in the index + $ret .= ''; $ret .= $base; $ret .= ''; }else{ -- cgit v1.2.3 From 74ef17786eb9ce751a8dd7c66ab7523efa92c79f Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Thu, 1 Aug 2013 22:46:16 +0200 Subject: include namespace links when index access from the wiki start page and no automatic sitemap.xml is being generated. --- inc/html.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index 53a100ec7..5f94d7dce 100644 --- a/inc/html.php +++ b/inc/html.php @@ -854,13 +854,17 @@ function html_index($ns){ * @author Andreas Gohr */ function html_list_index($item){ - global $ID; + global $ID, $conf; + + // prevent searchbots needlessly following links - only necessary when accessed from the homepage and no sitemap.xml is being generated + $nofollow = ($ID != $conf['start'] || $conf['sitemap']) ? ' rel="nofollow"' : ''; + $ret = ''; $base = ':'.$item['id']; $base = substr($base,strrpos($base,':')+1); if($item['type']=='d'){ // FS#2766, no need for search bots to follow namespace links in the index - $ret .= ''; + $ret .= ''; $ret .= $base; $ret .= ''; }else{ -- cgit v1.2.3 From b8bc53ce8da2f0fb9cfedb01df6507b29f32daaa Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Thu, 1 Aug 2013 23:06:57 +0200 Subject: simplify comment --- inc/html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index 5f94d7dce..d43611940 100644 --- a/inc/html.php +++ b/inc/html.php @@ -856,7 +856,7 @@ function html_index($ns){ function html_list_index($item){ global $ID, $conf; - // prevent searchbots needlessly following links - only necessary when accessed from the homepage and no sitemap.xml is being generated + // prevent searchbots needlessly following links $nofollow = ($ID != $conf['start'] || $conf['sitemap']) ? ' rel="nofollow"' : ''; $ret = ''; -- cgit v1.2.3