Index: wp-includes/link-template.php =================================================================== --- wp-includes/link-template.php (revision 21424) +++ wp-includes/link-template.php (working copy) @@ -2129,7 +2129,7 @@ if ( 'relative' == $scheme ) $url = $current_site->path; else - $url = $scheme . '://' . $current_site->domain . $current_site->path; + $url = $scheme . '://' . trailingslashit( $current_site->domain ) . trailingslashit( $current_site->wp_siteurl_subdir ); if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) $url .= ltrim($path, '/'); Index: wp-includes/ms-load.php =================================================================== --- wp-includes/ms-load.php (revision 21424) +++ wp-includes/ms-load.php (working copy) @@ -142,6 +142,10 @@ $current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1; $current_site->domain = DOMAIN_CURRENT_SITE; $current_site->path = $path = PATH_CURRENT_SITE; + if( defined( 'WP_SITEURL_SUBDIR' ) ) + $current_site->wp_siteurl_subdir = WP_SITEURL_SUBDIR; + else + $current_site->wp_siteurl_subdir = $current_site->path; if ( defined( 'BLOG_ID_CURRENT_SITE' ) ) $current_site->blog_id = BLOG_ID_CURRENT_SITE; elseif ( defined( 'BLOGID_CURRENT_SITE' ) ) // deprecated. Index: wp-includes/ms-functions.php =================================================================== --- wp-includes/ms-functions.php (revision 21424) +++ wp-includes/ms-functions.php (working copy) @@ -1150,9 +1150,13 @@ populate_roles(); $wp_roles->_init(); - $url = untrailingslashit( $url ); + $url = $siteurl = untrailingslashit( $url ); // fix url. - update_option('siteurl', $url); + if ( defined( 'WP_SITEURL_SUBDIR' ) && WP_SITEURL_SUBDIR ) { + $siteurl = trailingslashit( $siteurl ) . WP_SITEURL_SUBDIR; + } + + update_option('siteurl', $siteurl); update_option('home', $url); update_option('fileupload_url', $url . "/files" ); update_option('upload_path', UPLOADBLOGSDIR . "/$blog_id/files"); Index: wp-includes/ms-default-constants.php =================================================================== --- wp-includes/ms-default-constants.php (revision 21424) +++ wp-includes/ms-default-constants.php (working copy) @@ -47,7 +47,7 @@ * @since 1.5.0 */ if ( !defined( 'SITECOOKIEPATH' ) ) - define( 'SITECOOKIEPATH', $current_site->path ); + define( 'SITECOOKIEPATH', $current_site->wp_siteurl_subdir ); /** * @since 2.6.0 Index: wp-admin/network.php =================================================================== --- wp-admin/network.php (revision 21424) +++ wp-admin/network.php (working copy) @@ -51,8 +51,8 @@ * @return bool Whether subdomain install is allowed */ function allow_subdomain_install() { - $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'siteurl' ) ); - if( false !== strpos( $domain, '/' ) || 'localhost' == $domain || preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $domain ) ) + $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) ); + if( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' == $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) return false; return true; @@ -144,13 +144,6 @@ function network_step1( $errors = false ) { global $is_apache; - if ( get_option( 'siteurl' ) != get_option( 'home' ) ) { - echo '
' . __('ERROR:') . ' ' . sprintf( __( 'Your WordPress address must match your Site address before creating a Network. See General Settings.' ), esc_url( admin_url( 'options-general.php' ) ) ) . '
' . __('ERROR:') . ' ' . __( 'The constant DO_NOT_UPGRADE_GLOBAL_TABLES cannot be defined when creating a network.' ) . '
wp-config.php file in %s
above the line reading /* That’s all, stop editing! Happy blogging. */
:' ), ABSPATH ); ?>