Support » Networking WordPress » Why is blogs.dir/1/files/ visible in file URLs?

  • Resolved RavanH

    (@ravanh)


    Hi,

    On the main site of a multi-site install, all image and other uploaded file URLs show …/blogs.dir/1/files/… instead of just …/files/… like on all the other sites in the network.

    Why is that? I had not noticed it before. Is this since the upgrade to 3.1?

    Checking options like Fileupload Url it says …/files/ just like it should but still files in the Media Library are presented with the /blogs.dir/1/ in the path. All files are accessible via the URL without blogs.dir just fine, so there is no need for this happening.

    Is there anything I can do about it?

Viewing 15 replies - 1 through 15 (of 53 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    Lead Plugin Wrangler

    but still files in the Media Library are presented with the /blogs.dir/1/

    The media library only or the front end of the site?

    Yes, also when inserting images into posts: the /blogs.dir/1/ is visible in both the src=”” and in the link URL.

    So this is not normal behaviour or a known bug?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    Lead Plugin Wrangler

    Um. It’s supposed to point to /files/ (not blogs.dir) on the front end of everything. The image source etc.

    Check the per site settings again. There are, I think, three places where it refs image locations.

    Ipstenu, thanks for your support on this!

    The main site settings contain the following URL related options:

    Siteurl: http://mydomain.tld/
    Home: http://mydomain.tld/
    Upload Path: wp-content/blogs.dir/1/files
    Upload Url Path: (empty)
    Fileupload Url: http://mydomain.tld/files

    A sub-site (working correctly, with ID 2 in this example) has:

    Siteurl: http://sub.mydomain.tld/
    Home: http://sub.mydomain.tld/
    Upload Path: wp-content/blogs.dir/2/files
    Upload Url Path: (empty)
    Fileupload Url: http://sub.mydomain.tld/files

    This looks all correct to me and I did not find any other options that might be related 🙁

    ==========
    HYPOTHESIS
    ==========

    It occurred to me that I installed WP this in Multi-site mode from the start instead of installing it as a regular version and then upgrading to multi-site.

    On another installation where I followed the latter procedure, the main site was using /content/uploads/ and continues to use wp-content/uploads/ after the upgrade (and still visible on the front-end too) while all sub-sites use blogs.dir/x/files/ (visible as /files/ on the front end). I guess this is supposed to happen so if everybody installs as regular and then upgrades to multi-site, this behaviour will not be seen as a problem…

    … But when installing as multi-site from the get-go, this suddenly reveals the blogs.dir on the main site.

    Could that be going on?

    Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    So, fill me in. *How* did you install multisite from the get-go? I mean what steps?

    I’ve added the the first define when install WP, so the Network setup menu shows up first thing, and it worked fine.

    Hi Andrea, yes I remember doing the same. As opposed to the second install I spoke of, which was installed in regular mode and upgraded to multi-site in a later stage. Therem, the main site is using /wp-content/uploads/ … Apart from that, I see no differences between the two installations.

    ( That second install is also running Multi Networks for WordPress and if I clone the main site to become a new network, the main site on that network will use /blogs.dir/x/files/ just like the main site on my first install. Which leads me to conclude that there is no real difference between the two. )

    So even when adding the allow multi-site define during install, I should be seeing /files/ on the main site too?

    I really wonder what went wrong then. And if the sites options are correct, is there anything else (like something in the wp_blogs table) I can edit in the DB to change this?

    Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    Lemme consult with the brains part of this operation.

    Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    AHA!

    Expected behaviour.

    basically, during setup it;s checking to see if it’s multisite, and even tho we’re setting up the first and only blog, WP sees the multisite define in there and goes “oh yeah, multisite, use blogs.dir…” and continues.

    So. Expected behaviour. (I guess. makes snese tho.)

    Thanks Adrea for checking this out 🙂

    But… After going “oh yeah, multisite, use blogs.dir..,” why would WP not continue with: “… and do that neat blogs.dir hiding trick on the front end…”?

    Would that not be expected behaviour as well? Since it’s doing that for all sub sites, why not the main site?

    Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    Okay, I get why it’s doing that.

    So, you tricked WP firs toff my putting that line in there at the first, so it set the uploads folders as if it were an upgraded MU install.

    But then, continuing with setting up the network trips WP into going, “Okay, don’t do the rewrite thingy on the main blog”.

    Hmmm… right, so I should not have done that installation as multi-site from the start then. I’ll have to live with the consequences I suppose 😉

    But this behaviour poses another problem as well:

    I’m using ddean’s excellent plugin Networks for WordPress to create a second network on an install that uses wp-content/uploads/ on its main site (like it is supposed to do) … The problem is that this new network’s main site uses /blogs.dir/files/ !

    I’ve added the tag networks-for-wordpress to this thread in the hopes that we can find some way around this problem either by making WP use the /files/ trick on the main site or by making the Multi Networks plugin fix it for the main sites of sub-networks…

    Hope I explained that clear enough 😉

    Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    I’m using ddean’s excellent plugin Networks for WordPress to create a second network on an install that uses wp-content/uploads/ on its main site (like it is supposed to do) … The problem is that this new network’s main site uses /blogs.dir/files/ !

    A new network is not going to use the same uploads folder on the main blog period.

    In the db, it’s just another blog ID. Not a “main” one. It’ll use the blogs.dir folder.

    (we have a networks plguin too 😉 )

    Andrea, what networks plugin are you using? And does it not suffer from this issue?

    A new network is not going to use the same uploads folder on the main blog period.

    Obviously… but I am looking for a way to make WP use the /files/ URL on the other networks main sites. And in the case of my install where the main site uses blogs.dir/1/files/ too…

    To make it less confusing, let me divide this in into 2 questions:

    1. Is there a way to make WP use the /files/ URL instead of /blogs.id/1/files/ on the main site of my first install (where I installed with multi-site enabled from the start)?

    2. And if there is not, is there at least a way to make the plugin Networks for WordPress force the use of /files/ URL instead of /blogs.id/x/files/ on each of the other networks main sites?

    I am supposing here that if #1 is possible, #2 is no longer needed. But if #1 is not possible, #2 would be better than nothing at all…

    Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    1. reinstall.

    2. no, this is *not possible*. Doesn’t matter what networks plugin you use, it’s got nothing to do with it.

    in the database, the main site of the second network is just an incremented blog id. could be 29 or 4827356824. It’s not blog ID 1 on site id 2. So no, what you want (wp-content/uploads on main site in second and subsequent networks) just is not possible.

    It is only for blog ID 1. that is it.

    Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    Oh hey, lemme reread that. 😀

    is there at least a way to make the plugin Networks for WordPress force the use of /files/ URL instead of /blogs.id/x/files/ on each of the other networks main sites?

    I think you’ve mucked something up here.

    See this?

    http://atypicalife.net/blog/2011/03/01/worlds-biggest-igloo/5x8o/

    It’s a rewritten url for an image, right?

    It’s on a second network.

    If I were you I’d redo the entrie install. Or try this plugin:
    http://wordpress.org/extend/plugins/wp-multi-network/

    I don’t think our (right here, yes it’s paid) would fix the issue at all.

Viewing 15 replies - 1 through 15 (of 53 total)
  • The topic ‘Why is blogs.dir/1/files/ visible in file URLs?’ is closed to new replies.