WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Missing / for newly created websites (16 posts)

  1. Matt
    Member
    Posted 3 years ago #

    I've dabbled with multisite before, and have decided to come back to it. I don't remember if this was an issue before, but it is becoming one now.

    The problem:
    When a new blog is created, everything goes fine. Except for one major issue:

    a trailing slash is left out of the URL. (backend, blog, etc.)

    So, let's say I make a new blog called "test". It then becomes "http://my.scarform.commyscarformtest/" instead of "http://my.scarform.com/myscarformtest/".

    I can edit the site in the Super tools by adding a / to the beginning of the path and it works perfectly. Of course, if I am to start getting tons of signups, I am not wanting to manually edit each new website that appears (and it's also a pain because it's not working right off the bat by automatically adding that / where it needs to go).

    To clarify: everything works but that. Images upload fine, and once the / is added to the path of the site, it works as well. But what is causing the system to not automatically add that / when blogs are newly created?

  2. What's your ReWrite base in your .htaccess?

    What are your network settings in your wp-config.php? They should be like this:

    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'domain.com' );
    define('PATH_CURRENT_SITE', '/' );
    define('SITE_ID_CURRENT_SITE', 3);
    define('BLOGID_CURRENT_SITE', '3' );
    define('WP_ALLOW_REPAIR', true);
  3. Matt
    Member
    Posted 3 years ago #

    Rewrite:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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>
    # END WordPress

    And using the above wp-config entry, it still spits out the same problem.

  4. Somewhere in there you're missing a / obviously. But you knew that :)

    In your database, look in wp_sitemeta where there should be a basepath (I think that's where it is...). That too should be /

  5. Tim Moore
    Moderator
    Posted 3 years ago #

    Check your wp_blogs table. There should be a column for domain and one for path. path should start with a slash (/) or contain only a slash (if it is the root site).

    If those path is missing the first slash, you've misconfigured something.

  6. Matt
    Member
    Posted 3 years ago #

    @ ipstenu
    Couldn't find basepath - but everything that should have been a / directory was.

    @Tim
    Checked wp_blogs, and added a / to both domain and path. Created a test blog, and had the same issue. / was still not being added upon the creation of a new blog.

  7. wp-config file - go check it. Look for base="/"

  8. Matt
    Member
    Posted 3 years ago #

    @ Andrea_r:
    I'm guessing the base="/" you're talking about is the same as the one ipstenu provided in the wp-config example code? If so - it's already there.

  9. Tim Moore
    Moderator
    Posted 3 years ago #

    Have you modified Core files or are you using a fresh download of code from wordpress.org?

    If a slash is missing when you create a blog, something has changed either in Core files or in your configuration. If you can, set up a fresh install (entirely new database, entirely new download from wordpress.org) and see if you can recreate the error.

  10. Matt
    Member
    Posted 3 years ago #

    @ Tim
    Fresh install, fresh database - I never modify core files.

  11. And absolutely no plugins? Because I can't reproduce this.

    Are you adding new blogs from the frontend or the backend? (yes, it could matter)

    And what webhost? Some have crippled multisite installs if they detect you've turned it on.

    Edit:

    Fresh install,

    you neglected to mention you were running Buddypress with a custom template. Yes, it totally matters. A fresh install means no plugins or new themes.

    Disable BP. Go to Twenty Ten. Create a blog.

  12. Matt
    Member
    Posted 3 years ago #

    Ok so if the SQL tables appear as they should, and wp-config appears as it should, then can I safely assume that it is a Buddypress issue? I would like to get this solved without having to strip anything out that is currently in place, and if I can get a sort of "maybe this is where you should be looking" kind of directionality on this topic, that would be greatly appreciated.

  13. You can only assume it's Buddypress if you turn off the plugin and it magically works.

  14. Matt
    Member
    Posted 3 years ago #

    Where in the WordPress files does it draw the signup form from? And when creating new sites multisite, is it supposed to add the database name to the new site name?

  15. BuddyPress overrides the default signup form. Without plguins, it;s at wp-signup.php on the front end, or under Super Admin -? Sites -? Add Site in the backend.

    And when creating new sites multisite, is it supposed to add the database name to the new site name?

    AHA! No, it does not. This is the frist I;ve seen mention of that, and THAT is a well-known and reported issues.

    You;re on Dreamhost, right? And used the One-click option? Scroll down in wp-config.php and see where they added all kidns of crap including another base line with your db name.

    Remove that line.

  16. Matt
    Member
    Posted 3 years ago #

    Bloody brilliant.

    Removing:
    $base = DB_NAME;

    Corrected it completely. @Andrea_r - Thank you so very much!

Topic Closed

This topic has been closed to new replies.

About this Topic