The MU forums have moved to WordPress.org

Troubles with Multiple Blogs (20 posts)

  1. benz0r
    Member
    Posted 14 years ago #

    Currently I'm having this issue: Firstly, let's say my main blog, the main WPMU install blog is running the default WordPress theme. Then I log into my second WPMU blog that I made, and change the theme over there to the Classic theme. The theme changed, as well as the main's! That is something that I find incorrect.

    Also, I tried editing the "Hello World!" post on the main blog, and the same change appeared on the second blog.

    Perhaps this is a bug? Do I need to reinstall my WordPress MU? Is there any changes I need to make in the settings?

  2. andrea_r
    Moderator
    Posted 14 years ago #

    No, something's up on your end. I'd say it wasn't installed correctly.

  3. benz0r
    Member
    Posted 14 years ago #

    As I've looked into this issue, I believe it's the mod_rewrite that is affecting this.

    For example:

    This link works: http://example.com/sdfsdfsdfsdfdsf/wp-admin/

    And I do not have a directory of this name: sdfsdfsdfsdfdsf.

    Also, let's say I go into my second blog: from the /blog directory. So, I'll be located at http://example.com/blog. I see the first Hello World! post, I click the title, and it links me to http://example.com/?p=1. In the HTML the link is http://example.com/?p=1 also.

    Something is completely messed up, and I have not touched, or edited any of the system files. I just installed it.

  4. andrea_r
    Moderator
    Posted 14 years ago #

    Yep, mod_rewrite on the server. in other words, it's not MU.

    What kind of server are you on?

  5. benz0r
    Member
    Posted 14 years ago #

    I'm on a Linux (CentOS) shared hosting server running with cPanel and Apache. PHP5, mod_rewrite enabled.

  6. benz0r
    Member
    Posted 14 years ago #

    RewriteEngine On
    RewriteBase /
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    That is the .htaccess code if needed.

  7. andrea_r
    Moderator
    Posted 14 years ago #

    Is this an add-on domain perchance?

    (yeah, that's the default htaccess - you're not putting it there are you?)

  8. mjaques
    Member
    Posted 14 years ago #

    Hi,

    I'm having the same problem as the above user, same situation in a subdomain with separate working database using the default htaccess, though I'm not much of a coder. I can't even find the file!

    m

  9. xzistance3
    Member
    Posted 13 years ago #

    I am also having the same problem. The weird part is I have it working perfectly on a subdomain with a different database. But on my main wordpress mu site on the site root, additional blogs aren't functioning properly.

    I checked my .htaccess file and it's the default one like it seems it should be, but definitely not working.

    I've inspected the database tables pretty thoroughly and don't suspect it to be a wp coding issue. All the appropriate tables and settings are there, it's like wordpress isn't seeing /newblogurl as it is.

    Anyone solve this issue or know how to??

  10. andrea_r
    Moderator
    Posted 13 years ago #

    Quick check: do the permalinks off the main blog work correctly?

  11. xzistance3
    Member
    Posted 13 years ago #

    Hey Andrea,

    Yea, they definitely do.
    We're using a custom structure: /%category%/%postname%/

  12. xzistance3
    Member
    Posted 13 years ago #

    The main blog is at "/". We have a category base that uses "/blog", so technically our structure is:

    /blog /%category%/%postname%/

    And I have a new blog created that is at "/stories". I'd like to manipulate it more, but right now it's not even recognizing /stories as the new blog, and neither is /stories/wp-admin/. The dashboard and settings all show the settings from the default main blog.

  13. xzistance3
    Member
    Posted 13 years ago #

    I've done some tracing through wpmu-settings.php in the root folder, and I'm finding that on our live site, this returns null:

    $current_blog = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = %s", $domain, $path) );

    I checked the $domain and $path parameters, and they returned:
    domain = ourdomain.com
    path = /stories/

    Now, I've noticed that the issue is that our domains for our blogs are defined as "www.ourdomain.com", with the "www." in front. That is why it is not detecting the blog with that query.

    Are the domains for blogs on root www. domains not supposed to have "www." in them? I've never ran across this in any of the install documentation and I'm worried if I just remove the "www." from our blog domain definitions that the site will get screwed up somehow. And I definitely don't want the blog to think it's at "http://ourdomain.com". For SEO purposes, it definitely needs to be working at "http://www.ourdomain.com".

    I hope this makes sense and that someone can provide some feedback/answers. Thanks!

  14. andrea_r
    Moderator
    Posted 13 years ago #

    You need:

    AllowOverride FileInfo Options

    in the vhost entry in Apache for that web account, so mod_rewrite will properly read the htaccess file and use it.

  15. xzistance3
    Member
    Posted 13 years ago #

    If my permalink structure working, isn't it already using the htaccess file?

  16. andrea_r
    Moderator
    Posted 13 years ago #

    That's what I've always thought, but I did some checks on my own. I disabled the htacess file on a working install, and the main blog permalinks still worked because mod_rewrite was enabled. But the sub-blogs were nowhere to be found. That's how I reproduced the issue.

    So the above command forces it to read the htaccess file.

  17. xzistance3
    Member
    Posted 13 years ago #

    Here are the current definitions for this site's vhost file:

    <Directory /dir/to/our/siteroot/>
    DirectoryIndex index.php
    Options FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>

    I think those settings should work right? With the AllowOverride All setting.

  18. xzistance3
    Member
    Posted 13 years ago #

    I tried putting in AllowOverride FileInfo Options in to my entry and restarting apache, but it didn't work.

    Same as before, which I kind of suspected because it's the query that isn't finding the blog.

  19. xzistance3
    Member
    Posted 13 years ago #

    Alright, I figured it out. It has exactly to do with defining the domain of your blog as being http://www.yourdomain.com.

    It must be: yourdomain.com (no www.)

    Otherwise it won't find it. After I changed the domain which gets defined in wp_blogs under the 'domain' field, it worked in both the front-end and back-end.

    Something to note for users.

  20. andrea_r
    Moderator
    Posted 13 years ago #

    We have. Repeatedly.

    But in 3.0, it will support the www.

About this Topic