WordPress.org

Make WordPress Core

Ticket #11845: 11845.2.diff

File 11845.2.diff, 1.0 KB (added by miqrogroove, 4 years ago)
  • wp-admin/network.php

     
    283283// Construct an htaccess file. 
    284284$htaccess_file = 'RewriteEngine On 
    285285RewriteBase ' . $base . ' 
     286RewriteRule ^index\.php$ - [L] 
    286287 
    287288# uploaded files 
    288289RewriteRule ^' . ( $vhost ? '([_0-9a-zA-Z-]+/)?' : '' ) . 'files/(.+) wp-includes/ms-files.php?file=$2 [L]' . "\n"; 
  • wp-includes/rewrite.php

     
    16831683                $rules = "<IfModule mod_rewrite.c>\n"; 
    16841684                $rules .= "RewriteEngine On\n"; 
    16851685                $rules .= "RewriteBase $home_root\n"; 
     1686                $rules .= "RewriteRule ^index\.php$ - [L]"; // Prevent -f checks on index.php. 
    16861687 
    16871688                //add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all) 
    16881689                foreach ( (array) $this->non_wp_rules as $match => $query) {