Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.416
diff -u -p -r1.416 bootstrap.inc
--- includes/bootstrap.inc	22 Aug 2010 14:11:47 -0000	1.416
+++ includes/bootstrap.inc	9 Sep 2010 09:38:39 -0000
@@ -2430,6 +2430,8 @@ function language_default($property = NU
  *   base_path() returns "/drupalfolder/".
  * - http://example.com/path/alias (which is a path alias for node/306) returns
  *   "path/alias" as opposed to the internal path.
+ * - http://example.com/index.php returns an empty string (meaning: front page)
+ * - http://example.com/index.php?page=1 returns an empty string
  *
  * @return
  *   The requested Drupal URL path.
@@ -2451,11 +2453,16 @@ function request_path() {
     $path = $_GET['q'];
   }
   elseif (isset($_SERVER['REQUEST_URI'])) {
-    // This is a request using a clean URL. Extract the path from REQUEST_URI.
+    // This request may be using a clean URL. Extract the path from REQUEST_URI.
     $request_path = strtok($_SERVER['REQUEST_URI'], '?');
     $base_path_len = strlen(rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/'));
     // Unescape and strip $base_path prefix, leaving q without a leading slash.
     $path = substr(urldecode($request_path), $base_path_len + 1);
+    // If the path equals the script filename, the front page is served.
+    // This also allows renaming index.php.
+    if ($path == pathinfo($_SERVER['PHP_SELF'], PATHINFO_BASENAME)) {
+      $path = '';
+    }
   }
   else {
     // This is the front page.
