From 403bf947e12075361dc6f57dbe08e75a34cce6b9 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 11 Mar 2010 22:58:43 +0000 Subject: [PATCH] Don't check for the existence of index.php in the htaccess rewrite rules. props miqrogroove. see #11845 git-svn-id: https://develop.svn.wordpress.org/trunk@13676 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/network.php | 3 ++- wp-includes/rewrite.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-admin/network.php b/wp-admin/network.php index 9fcfdf43fd..78ed836e77 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -283,6 +283,7 @@ define( 'BLOG_ID_CURRENT_SITE', 1 ); // Construct an htaccess file. $htaccess_file = 'RewriteEngine On RewriteBase ' . $base . ' +RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^' . ( $vhost ? '([_0-9a-zA-Z-]+/)?' : '' ) . 'files/(.+) wp-includes/ms-files.php?file=$2 [L]' . "\n"; @@ -303,7 +304,7 @@ $htaccess_file .= "\nRewriteRule . index.php [L]"; ?>
  • .htaccess file in %s, replacing other WordPress rules:' ), ABSPATH ); ?>

    -
  • diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index 8dc2af75ee..579a13c62f 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -1683,6 +1683,7 @@ class WP_Rewrite { $rules = "\n"; $rules .= "RewriteEngine On\n"; $rules .= "RewriteBase $home_root\n"; + $rules .= "RewriteRule ^index\.php$ - [L]"; // Prevent -f checks on index.php. //add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all) foreach ( (array) $this->non_wp_rules as $match => $query) {