• Resolved Rolf Allard van Hagen

    (@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 - 31 through 45 (of 53 total)
  • Can you create a new site within one of the networks in your MultiNetwork setup? Once you do that, try uploading media to the new site. See if it has the same issue.

    I just noticed on one of my multi-network setups that all of my “networks” (the root sites for each network), the media URLs seem to include the /blogs.dir/, but if I create a site in one of those networks and upload media to that inner site, the URL is the way it should be.

    I wonder if that might be the same issue you’re seeing. If so, I’d guess it has something to do with WordPress not realizing that the new network should have its media URLs rewritten (since, in a normal multisite [not multi-network] environment, the first blog would not have rewritten URLs for its media, as those files would be placed in the uploads folder instead).

    @curtis – which network plugin are you using? I can;t remember offhand if it’s ours or not.

    On my second network, I can upload media to the main site and it has the /files/ address in there.

    example: http://atypicalife.net/files/2011/05/4711094896_0ac9156ced_b-crop.jpg

    Andrea – I have yours installed right now. I’m thinking about resetting the installation to see if I can reproduce the issue or if the issue was caused by something in the original install.

    Yeah, at this point I’d love to find out where it’s falling down.

    I wonder if that might be the same issue you’re seeing.

    @curtis, that is exactly the issue I am seeing too…

    Our common denominator is not the Multi-Network plugin (as I’m using Networks for WordPress) but I do have your Extended Super Admin plugin running …

    Might that be influencing WP’s thought process in URL handling here?

    @ravanh – It shouldn’t be (it doesn’t have anything at all to do with URLs), but I’ll run some testing to make sure.

    Okay. I completely reset our WordPress installation. I deleted everything, downloaded the latest package, installed it, ran the installation/configuration, logged in and then performed the steps to set up a “network”. After that, I added the Networks+ mu-plugin (no other plugins, mu-plugins or themes are installed) and added a few extra networks.

    With those steps, everything worked the way it should.

    However, I then realized I had failed to comment out the necessary lines in my wp-config.php file to make the “Network Admin” link (and logins) work the way it should.

    As soon as I commented out the following lines from my wp-config.php file, the top-level “networks” started doing the same thing again (adding the blogs.dir to the URL of the media, rather than rewriting it to the appropriate files location):

    define( 'DOMAIN_CURRENT_SITE', 'www.example.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    Did I comment out something I shouldn’t have? I initially commented out the following line, too (since it occurs between the PATH_CURRENT_SITE and BLOG_ID_CURRENT_SITE definitions), but then uncommented it.

    define( 'SITE_ID_CURRENT_SITE', 1 );

    Do you see anything I might have done wrong? I even tried resetting the permalinks on one of the networks, and that still didn’t help.

    Curtis,

    I’ve been looking at those lines before too since the instructions for NetworksforWordPress say that

    define( 'DOMAIN_CURRENT_SITE', 'www.example.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );

    should be commented out. Which I had. So I tried commenting out define( 'BLOG_ID_CURRENT_SITE', 1 ); too (so an inverted order of what you did but resulting in the same) to see if that would change anything. It did not change, so I left it all alone…

    What happens when you uncomment those lines again?

    It’s all 4 lines.

    After a bit more investigation, I’ve found that, if either (or both) of these lines are commented out, that’s when it fails:

    define( 'DOMAIN_CURRENT_SITE', 'www.example.com' );
    define( 'PATH_CURRENT_SITE', '/' );

    I’m not sure why removing those lines is causing the issue, but it is. If I uncomment them both (again, they both have to be uncommented), the URL for the media begins working fine again. As soon as either of them is commented/removed again, the URLs for media on top-level networks go back to using blogs.dir instead of files.

    @andrea – Is your installation a fairly new install (since the merge) or was it originally a WPMU install? I’m wondering if maybe older installs don’t have this issue (I may try installing WPMU, getting it set up, then upgrading to see if the issue reappears).

    Has anyone else been able to reproduce this issue?

    Yeah, it’s an upgraded install.

    I read your post out to Ron, and before I got to those two lines, he guessed the ones you posted. ;P

    It makes sense to me, because clearly both those lines redirect some part of WordPRess into thinking that the main site is the head of the network. So the second network site – which is still a SUB site – has only part of the info it needs.

    Just make sure you comment out those lines. It *is* in the instructions. 😉

    If these problems are related to having the *_CURRENT_SITE constants undefined, then feel free to uncomment them. The decision to instruct commenting them out was based on my best reading of the site routing logic, and while it causes no problems on our install and many others, it’s definitely worth considering as a source of issues.

    Unless there are more issues at play here, I’ll change the instruction to a troubleshooting step. People seem to be running fine with those constants in place, and the fewer file edits needed the better.

    I’ve been running a multi-site setup with Networks for WordPress and

    define( 'DOMAIN_CURRENT_SITE', '....' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    in wp-config.php for a while now without problems.

    But the original issue of showing /blogs.dir/X/files/ in media URLs has not been solved. Not even for new networks created after the change to wp-config… 🙁

    I’m chiming in with my experience just in case more reproducers are of any help. I’ve encountered the issue @RavanH described in the initial post on my multisite install: files uploaded onto the root blog get url’s with blogs.dir while subsites (in subdirectories) get url’s without it.

    I was running WPMU just prior to it getting integrated into WP proper, but unfortunately I can’t say for sure whether I did a clean reinstall or an upgrade to WP (non-MU) at that point.

    I’m only running a single network with none of the plugins mentioned in this thread thus far. Well, no, actually I do run another multisite for testing purposes, completely separate from the first, and there this issue doesn’t manifest.

    The upload-related variables for the main site are as follows:

    `Upload Url Path:
    Upload Path: wp-content/blogs.dir/1/files
    Fileupload Url: http://mummila.net/files`

    I suspect the Upload Path is what’s causing this; further evidence is that on the testing site Upload Path: wp-content/uploads results in url’s without blogs.dir.

    I’m thinking of changing Upload Path, but I’m unsure where it ultimately should point to. If wp-content/uploads results in corresponding url’s, is that the default for the root blog? If so, is there a reason why it deviates from what the sub-sites have, which is sitepath/files? I’d expect the root site to have /files/ as attachment url base.

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