WordPress.org

Forums

[resolved] Another missing images problem (7 posts)

  1. djlivi
    Member
    Posted 1 year ago #

    I'm running multi-site, and some update (wordpress or host) some months ago broke images, but I've not been able to find much time to look into it till now.

    Across all sites, the common problem is that images and thumbnails don't appear unless I try to 'edit' the image, when it suddenly shows up - so something wrong with the rewrite.

    I managed to work out that php readfile had been disabled on the host, but that has been fixed, but still no images or thumbnails.

    If I add the following to .htaccess, I get images and thumbnails working on *one* of the blogs, by bypassing msfiles.php altogether:

    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-content/blogs.dir/3/files/$2 [L]

    Using the regular rule I get a server 500 error

    any ideas?

  2. rfair404
    Member
    Posted 1 year ago #

    what rules are you using at the moment?

    it should look like this in a "typical" install.

    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

  3. djlivi
    Member
    Posted 1 year ago #

    I've tried both of the following, neither of which works:

    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    # OR this
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    (obviously not both at the same time)

    With either of these, images are completely broken - trying to load a single image giving a 500 error :-/

  4. rfair404
    Member
    Posted 1 year ago #

    have you confirmed that the files still exist on the server and that the permissions are set correctly?

    Can you browse to one of the files by entering the url manually into your browser?

  5. djlivi
    Member
    Posted 1 year ago #

    The rule in the OP works for one of the blogs, by bypassing ms-files.php and going direct to the file - so the files are there alright.

    This is the latest in a relatively protracted series of attempts to fix up the site - it turned out that readfile was disabled previously but is enabled now.

    I have to admit that I'm pulling my hair out on this now - I've been going back and forward trying to sort this out, and just can't get any further.

    I have the domain mapping plugin enabled, and all blogs work except for media and thumbnails - and htaccess is clearly working as noted in the OP. Trying to use ms-files.php always seems to result in a 500 error.

  6. djlivi
    Member
    Posted 1 year ago #

    I'm going to close this - whatever has happened, something is deeply wrong somewhere.

    I can bypass the problem using .htaccess to determine which blog is being addressed, and rewrite to the appropriate folder, along the lines of:

    RewriteCond %{HTTP:Host} ^(www\.)?blogone\.com$ [OR]
    RewriteCond %{HTTP:Host} ^blogonedotcom\.hostdomain\.com$
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-content/blogs.dir/3/files/$2 [L]

    I can repeat that block of code for each of the small number of blogs on my site - as the number of blogs is small and rarely added to, I can live with this.

    Not very happy, as this is clearly a hack workaround, and I'd much prefer to be able to properly fix whatever is broken... but it works.
    Will do until someday I move the entire host over...

  7. djlivi
    Member
    Posted 1 year ago #

    ...and checking the tickbox now to close this!

Topic Closed

This topic has been closed to new replies.

About this Topic