When creating a network, use get_home_path() to calculate where .htaccess (or web.config) lives. fixes #22639.
git-svn-id: http://core.svn.wordpress.org/trunk@22982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e0587d894e
commit
787e7f8347
|
@ -316,6 +316,8 @@ function network_step2( $errors = false ) {
|
||||||
$wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) );
|
$wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) );
|
||||||
$rewrite_base = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : '';
|
$rewrite_base = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : '';
|
||||||
|
|
||||||
|
$home_path = get_home_path();
|
||||||
|
|
||||||
$location_of_wp_config = ABSPATH;
|
$location_of_wp_config = ABSPATH;
|
||||||
if ( ! file_exists( ABSPATH . 'wp-config.php' ) && file_exists( dirname( ABSPATH ) . '/wp-config.php' ) )
|
if ( ! file_exists( ABSPATH . 'wp-config.php' ) && file_exists( dirname( ABSPATH ) . '/wp-config.php' ) )
|
||||||
$location_of_wp_config = trailingslashit( dirname( ABSPATH ) );
|
$location_of_wp_config = trailingslashit( dirname( ABSPATH ) );
|
||||||
|
@ -353,9 +355,9 @@ function network_step2( $errors = false ) {
|
||||||
<h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
|
<h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
|
||||||
<p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
|
<p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
|
||||||
<div class="updated inline"><p><?php
|
<div class="updated inline"><p><?php
|
||||||
if ( file_exists( ABSPATH . '.htaccess' ) )
|
if ( file_exists( $home_path . '.htaccess' ) )
|
||||||
printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), '.htaccess' );
|
printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), '.htaccess' );
|
||||||
elseif ( file_exists( ABSPATH . 'web.config' ) )
|
elseif ( file_exists( $home_path . 'web.config' ) )
|
||||||
printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), 'web.config' );
|
printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), 'web.config' );
|
||||||
else
|
else
|
||||||
_e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' );
|
_e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' );
|
||||||
|
@ -458,7 +460,7 @@ define('BLOG_ID_CURRENT_SITE', 1);
|
||||||
EOF;
|
EOF;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<li><p><?php printf( __( 'Add the following to your <code>web.config</code> file in <code>%s</code>, replacing other WordPress rules:' ), trailingslashit( str_replace( trailingslashit( $wp_siteurl_subdir ), '', ABSPATH ) ) ); ?></p>
|
<li><p><?php printf( __( 'Add the following to your <code>web.config</code> file in <code>%s</code>, replacing other WordPress rules:' ), $home_path ); ?></p>
|
||||||
<?php
|
<?php
|
||||||
if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' )
|
if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' )
|
||||||
echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';
|
echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';
|
||||||
|
@ -492,7 +494,7 @@ RewriteRule . index.php [L]
|
||||||
EOF;
|
EOF;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>
|
<li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), $home_path ); ?></p>
|
||||||
<?php
|
<?php
|
||||||
if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' )
|
if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' )
|
||||||
echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';
|
echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';
|
||||||
|
|
Loading…
Reference in New Issue