diff --git a/includes/form.inc b/includes/form.inc
index f7671be..b1fe7e3 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -3979,8 +3979,11 @@ function form_process_autocomplete($element) {
     // browser interpreting the path plus search string as an actual file.
     $current_clean_url = isset($GLOBALS['conf']['clean_url']) ? $GLOBALS['conf']['clean_url'] : NULL;
     $GLOBALS['conf']['clean_url'] = 0;
-    $element['#autocomplete_input']['#url_value'] = url($element['#autocomplete_path'], array('absolute' => TRUE));
+    $url = url($element['#autocomplete_path'], array('absolute' => TRUE));
     $GLOBALS['conf']['clean_url'] = $current_clean_url;
+    // Include index.php to the path in case the server DirectoryIndex option is different.
+    $url = str_replace("?q=", "index.php?q=", $url);
+    $element['#autocomplete_input']['#url_value'] = $url;
   }
   return $element;
 }
