WordPress.org

Make WordPress Core

Ticket #20746: 20746.1.patch

File 20746.1.patch, 1.0 KB (added by thomaswm, 5 years ago)

Alternative approach: Remove question mark from rewrite rule

  • src/wp-admin/network.php

     
    510510                        $ms_files_rewriting .= $subdir_match . "files/(.+) {$rewrite_base}" . WPINC . "/ms-files.php?file={$subdir_replacement_12} [L]" . "\n";
    511511                }
    512512
     513                $subdir_match_exclusive = rtrim( $subdir_match, '?' );
     514
    513515                $htaccess_file = <<<EOF
    514516RewriteEngine On
    515517RewriteBase {$base}
     
    521523RewriteCond %{REQUEST_FILENAME} -f [OR]
    522524RewriteCond %{REQUEST_FILENAME} -d
    523525RewriteRule ^ - [L]
    524 RewriteRule ^{$subdir_match}(wp-(content|admin|includes).*) {$rewrite_base}{$subdir_replacement_12} [L]
    525 RewriteRule ^{$subdir_match}(.*\.php)$ {$rewrite_base}$subdir_replacement_12 [L]
     526RewriteRule ^{$subdir_match_exclusive}(wp-(content|admin|includes).*) {$rewrite_base}{$subdir_replacement_12} [L]
     527RewriteRule ^{$subdir_match_exclusive}(.*\.php)$ {$rewrite_base}$subdir_replacement_12 [L]
    526528RewriteRule . index.php [L]
    527529
    528530EOF;