0

New WordPress 3.5.2 multisite (subdirectory) install is missing a slash when creating new blogs.

WordPress is installed to server like:

blogs.domain.com

When a new user registers, the conformation email has the URL for their blog like:

blogs.domain.comnewuser (missing the / between the domain and blog name).

From Network Admin, I can edit the site, adding a / to either the end of the Domain field or the begining of the Path field and the site can be accessed:

blogs.domain.com/newuser

wp-config:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>

Adding $base = '/'; to wp-config didn't seem to make a difference.

.htaccess:

define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'blogs.domain.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
fine('BLOG_ID_CURRENT_SITE', 1);

DB:

wp_site has:

domain: blogs.domain.com path: /

wp_blogs has:

domain: blogs.domain.com path: /

but when a new user/blog is added, wp_blogs gets:

domain: blogs.domain.com path: user/

  • WPMU Ldap Auth plugin is being used also. – ClevelandState Aug 3 '13 at 13:25
0

WPMU Ldap Authentication was causing the incorrect URL issue. Disabling the plugin allowed users/sites to be created correctly.

This site has a fix for the plugin that allows it to run properly in WP 3.5.2: http://www.fotan.net/wpmu-ldap-plugin-fixes/

-1

do not blame the .htaccess file.

Edit wpmuldap/lib/wpmu_ldap.functions.php

$domain = strtolower( wp_specialchars( $newUserName ) );
    if( constant( "VHOST" ) == 'yes' ) {
        $newdomain = $domain . "." . $current_site->domain;
        $path = '/' . $base;
    }
    else {
        $newdomain = $current_site->domain;
        $path = '/' . $base . $domain . '/';
    }

Notice that I modified the $path variable adding a leading / using: " '/' . " Right after that everything works fine.

I am using WP 3.9.1 with WPMU Ldap Authentication ver 4.0.2 using "Network" mode.

  • NEVER change core files or theme/plugin files if you are not the author – Pieter Goosen Jul 22 '14 at 5:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.