diff --git a/inc/html.php b/inc/html.php
index 53a100ec73e1374e3da329f8808bac14b2130929..5f94d7dce7c7448746ed2b3baef913127d7f0415 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -854,13 +854,17 @@ function html_index($ns){
  * @author Andreas Gohr <andi@splitbrain.org>
  */
 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 .= '<a href="'.wl($ID,'idx='.rawurlencode($item['id'])).'" title="' . $item['id'] . '" class="idx_dir" rel="nofollow"><strong>';
+        $ret .= '<a href="'.wl($ID,'idx='.rawurlencode($item['id'])).'" title="' . $item['id'] . '" class="idx_dir"' . $nofollow . '><strong>';
         $ret .= $base;
         $ret .= '</strong></a>';
     }else{