diff --git a/wp-admin/network.php b/wp-admin/network.php index 9fcfdf43f..78ed836e7 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 8dc2af75e..579a13c62 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) {