Changeset 21823 for trunk/wp-admin/network.php
- Timestamp:
- 09/11/2012 10:22:20 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/network.php
r19956 r21823 107 107 '<p>' . __('Choose subdomains or subdirectories; this can only be switched afterwards by reconfiguring your install. Fill out the network details, and click install. If this does not work, you may have to add a wildcard DNS record (for subdomains) or change to another setting in Permalinks (for subdirectories).') . '</p>' . 108 108 '<p>' . __('The next screen for Network Setup will give you individually-generated lines of code to add to your wp-config.php and .htaccess files. Make sure the settings of your FTP client make files starting with a dot visible, so that you can find .htaccess; you may have to create this file if it really is not there. Make backup copies of those two files.') . '</p>' . 109 '<p>' . __('Add a <code>blogs.dir</code> directory under <code>/wp-content</code> and addthe designated lines of code to wp-config.php (just before <code>/*...stop editing...*/</code>) and <code>.htaccess</code> (replacing the existing WordPress rules).') . '</p>' .109 '<p>' . __('Add the designated lines of code to wp-config.php (just before <code>/*...stop editing...*/</code>) and <code>.htaccess</code> (replacing the existing WordPress rules).') . '</p>' . 110 110 '<p>' . __('Once you add this code and refresh your browser, multisite should be enabled. This screen, now in the Network Admin navigation menu, will keep an archive of the added code. You can toggle between Network Admin and Site Admin by clicking on the Network Admin or an individual site name under the My Sites dropdown in the Toolbar.') . '</p>' . 111 111 '<p>' . __('The choice of subdirectory sites is disabled if this setup is more than a month old because of permalink problems with “/blog/” from the main site. This disabling will be addressed in a future version.') . '</p>' . … … 190 190 $error_codes = $errors->get_error_codes(); 191 191 } 192 193 if ( WP_CONTENT_DIR != ABSPATH . 'wp-content' )194 echo '<div class="error"><p><strong>' . __('Warning!') . '</strong> ' . __( 'Networks may not be fully compatible with custom wp-content directories.' ) . '</p></div>';195 192 196 193 $site_name = ( ! empty( $_POST['sitename'] ) && ! in_array( 'empty_sitename', $error_codes ) ) ? $_POST['sitename'] : sprintf( _x('%s Sites', 'Default network name' ), get_option( 'blogname' ) ); … … 236 233 endif; 237 234 235 if ( WP_CONTENT_DIR != ABSPATH . 'wp-content' && ( allow_subdirectory_install() || ! allow_subdomain_install() ) ) 236 echo '<div class="error inline"><p><strong>' . __('Warning!') . '</strong> ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</p></div>'; 237 238 238 $is_www = ( 0 === strpos( $hostname, 'www.' ) ); 239 239 if ( $is_www ) : … … 361 361 ?> 362 362 <ol> 363 <li><p><?php364 printf( __( 'Create a <code>blogs.dir</code> directory at <code>%s/blogs.dir</code>. This directory is used to store uploaded media for your additional sites and must be writeable by the web server.' ), WP_CONTENT_DIR );365 if ( WP_CONTENT_DIR != ABSPATH . 'wp-content' )366 echo ' <strong>' . __('Warning:') . ' ' . __( 'Networks may not be fully compatible with custom wp-content directories.' ) . '</strong>';367 ?></p></li>368 363 <li><p><?php printf( __( 'Add the following to your <code>wp-config.php</code> file in <code>%s</code> <strong>above</strong> the line reading <code>/* That’s all, stop editing! Happy blogging. */</code>:' ), ABSPATH ); ?></p> 369 364 <textarea class="code" readonly="readonly" cols="100" rows="7"> … … 416 411 <match url="^index\.php$" ignoreCase="false" /> 417 412 <action type="None" /> 418 </rule> 419 <rule name="WordPress Rule 2" stopProcessing="true"> 413 </rule>'; 414 if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { 415 $web_config_file .= ' 416 <rule name="WordPress Rule for Files" stopProcessing="true"> 420 417 <match url="^files/(.+)" ignoreCase="false" /> 421 418 <action type="Rewrite" url="wp-includes/ms-files.php?file={R:1}" appendQueryString="false" /> 422 </rule> 423 <rule name="WordPress Rule 3" stopProcessing="true"> 419 </rule>'; 420 } 421 $web_config_file .= ' 422 <rule name="WordPress Rule 2" stopProcessing="true"> 424 423 <match url="^" ignoreCase="false" /> 425 424 <conditions logicalGrouping="MatchAny"> … … 429 428 <action type="None" /> 430 429 </rule> 431 <rule name="WordPress Rule 4" stopProcessing="true">430 <rule name="WordPress Rule 3" stopProcessing="true"> 432 431 <match url="." ignoreCase="false" /> 433 432 <action type="Rewrite" url="index.php" /> … … 447 446 <match url="^index\.php$" ignoreCase="false" /> 448 447 <action type="None" /> 449 </rule> 448 </rule>'; 449 if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { 450 $web_config_file .= ' 451 <rule name="WordPress Rule for Files" stopProcessing="true"> 452 <match url="^files/(.+)" ignoreCase="false" /> 453 <action type="Rewrite" url="wp-includes/ms-files.php?file={R:1}" appendQueryString="false" /> 454 </rule>'; 455 } 456 $web_config_file .= ' 450 457 <rule name="WordPress Rule 2" stopProcessing="true"> 451 <match url="^([_0-9a-zA-Z-]+/)?files/(.+)" ignoreCase="false" />452 <action type="Rewrite" url="wp-includes/ms-files.php?file={R:2}" appendQueryString="false" />453 </rule>454 <rule name="WordPress Rule 3" stopProcessing="true">455 458 <match url="^([_0-9a-zA-Z-]+/)?wp-admin$" ignoreCase="false" /> 456 459 <action type="Redirect" url="{R:1}wp-admin/" redirectType="Permanent" /> 457 460 </rule> 458 <rule name="WordPress Rule 4" stopProcessing="true">461 <rule name="WordPress Rule 3" stopProcessing="true"> 459 462 <match url="^" ignoreCase="false" /> 460 463 <conditions logicalGrouping="MatchAny"> … … 464 467 <action type="None" /> 465 468 </rule> 466 <rule name="WordPress Rule 5" stopProcessing="true">469 <rule name="WordPress Rule 4" stopProcessing="true"> 467 470 <match url="^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*)" ignoreCase="false" /> 468 471 <action type="Rewrite" url="{R:1}" /> 469 472 </rule> 470 <rule name="WordPress Rule 6" stopProcessing="true">473 <rule name="WordPress Rule 5" stopProcessing="true"> 471 474 <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" /> 472 475 <action type="Rewrite" url="{R:2}" /> 473 476 </rule> 474 <rule name="WordPress Rule 7" stopProcessing="true">477 <rule name="WordPress Rule 6" stopProcessing="true"> 475 478 <match url="." ignoreCase="false" /> 476 479 <action type="Rewrite" url="index.php" /> … … 483 486 ?> 484 487 <li><p><?php printf( __( 'Add the following to your <code>web.config</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p> 485 <textarea class="code" readonly="readonly" cols="100" rows="20"> 486 <?php echo esc_textarea( $web_config_file ); ?> 488 <?php 489 if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 490 echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>'; 491 ?> 492 <textarea class="code" readonly="readonly" cols="100" rows="20"><?php echo esc_textarea( $web_config_file ); ?> 487 493 </textarea></li> 488 494 </ol> … … 492 498 $htaccess_file = 'RewriteEngine On 493 499 RewriteBase ' . $base . ' 494 RewriteRule ^index\.php$ - [L] 495 496 # uploaded files 497 RewriteRule ^' . ( $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?' ) . 'files/(.+) wp-includes/ms-files.php?file=$' . ( $subdomain_install ? 1 : 2 ) . ' [L]' . "\n"; 500 RewriteRule ^index\.php$ - [L]' . "\n"; 501 502 if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { 503 $htaccess_file .= "\n# uploaded files\nRewriteRule ^"; 504 $htaccess_file .= ( $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?' ) . 'files/(.+) wp-includes/ms-files.php?file=$' . ( $subdomain_install ? 1 : 2 ) . ' [L]' . "\n"; 505 } 498 506 499 507 if ( ! $subdomain_install ) … … 512 520 ?> 513 521 <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p> 514 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>"> 522 <?php 523 if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 524 echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>'; 525 ?> 526 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo substr_count( $htaccess_file, "\n" ) + 1; ?>"> 515 527 <?php echo esc_textarea( $htaccess_file ); ?></textarea></li> 516 528 </ol>
Note: See TracChangeset
for help on using the changeset viewer.