WordPress.org

Make WordPress Core

Ticket #13540: network-suggested-rewrite.13540.diff

File network-suggested-rewrite.13540.diff, 2.1 KB (added by filosofo, 8 years ago)
  • wp-admin/network.php

     
    433433        <?php } else {
    434434                // Construct an htaccess file.
    435435                $htaccess_file = 'RewriteEngine On
    436                                 RewriteBase ' . $base . '
    437                                 RewriteRule ^index\.php$ - [L]
    438                                
    439                                 # uploaded files
    440                                 RewriteRule ^' . ( $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?' ) . 'files/(.+) wp-includes/ms-files.php?file=$' . ( $subdomain_install ? 1 : 2 ) . ' [L]' . "\n";
     436RewriteBase ' . $base . '
     437RewriteRule ^index\.php$ - [L]
     438
     439# uploaded files
     440RewriteRule ^' . ( $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?' ) . 'files/(.+) wp-includes/ms-files.php?file=$' . ( $subdomain_install ? 1 : 2 ) . ' [L]' . "\n";
    441441               
    442442                if ( ! $subdomain_install )
    443443                        $htaccess_file .= "\n# add a trailing slash to /wp-admin\n" . 'RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]' . "\n";
    444444               
    445445                $htaccess_file .= "\n" . 'RewriteCond %{REQUEST_FILENAME} -f [OR]
    446                                 RewriteCond %{REQUEST_FILENAME} -d
    447                                 RewriteRule ^ - [L]';
     446RewriteCond %{REQUEST_FILENAME} -d
     447RewriteRule ^ - [L]';
    448448               
    449449                // @todo custom content dir.
    450450                if ( ! $subdomain_install )
    451                         $htaccess_file .= "\n" . 'RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    452                                         RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]';
     451                        $htaccess_file .= "\nRewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]\nRewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]";
    453452               
    454453                $htaccess_file .= "\nRewriteRule . index.php [L]";
    455454               
    456455                ?>
    457456                <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>
    458                 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>">
    459                 <?php echo wp_htmledit_pre( $htaccess_file ); ?>
     457                <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>"><?php
     458                echo wp_htmledit_pre( $htaccess_file );
     459                ?>
    460460                </textarea></li>
    461461                </ol>
    462462        <?php }