WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Multisite Images not working on non-primary site (7 posts)

  1. toddhalfpenny
    Member
    Posted 1 year ago #

    Hi there,

    Another user here having image issues with MU non-primary site.

    The images are uploaded OK and can be seen by FTP client and when looking at the actual file path but in the front and backend the images cannot be seen. An example is as follows;

    Attachement URL: http://gingerbreaddesign.co.uk/todd/files/2012/11/RecoveryTools.png
    File's Server path: http://gingerbreaddesign.co.uk/wp-content/blogs.dir/2/files/2012/11/RecoveryTools.png

    I have checked the .htaccess and can confirm it us being queried... here it is

    # BEGIN WordPress
    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).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress

    I have also contacted my host and they have told me that AllowOveride is set to All.

    I'm certain that this was working some weeks ago and I'm not sure I have changed/upgraded anything which would affect this.

    Is anyone able to please give me any pointers as to where to look next? Are there any known ways of confirming the httpd.conf settings without hassling my hosts again?

    Thanks in advance,
    Todd

  2. The blank page is usually a PHP error.

    If this isn't happening on any other site, I would be inclined to say that there's a plugin or theme issue on that site.

  3. toddhalfpenny
    Member
    Posted 1 year ago #

    Thanks Mike... really appreciate your time.

    DO you think turning DEBUG flag on quickly be a quick way to see if it's a PHP error? Also do you know if there's likely to be some log on the server showing these?

    UPDATE : So I briefly turned on the DEBUG and found the following errors when viewing the image page

    Warning: include_once(/home/gingerb/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase1.php) [function.include-once]: failed to open stream: No such file or directory in /home/gingerb/public_html/wp-content/advanced-cache.php on line 8
    
    Warning: include_once() [function.include]: Failed opening '/home/gingerb/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase1.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/gingerb/public_html/wp-content/advanced-cache.php on line 8

    Googling this I saw that some folk had fixed this by removing the cache line from the wp-config file that the cache plugin adds. I did this (and removed the wp-super-cache plugin directory) and now I no longer see these PHP errors. This also means now that I see the "broken image" icon rather than just a blank page.

    I shall continue investigating but any further ideas would still be appreciated.

    Thanks again.

  4. JohnnyDuke
    Member
    Posted 1 year ago #

    I'm having the same problem, a few weeks ago, the non-primary wp site started to show only broken images, i've opened a ticket here:
    http://wordpress.stackexchange.com/questions/73783/broken-image-multisite

    I think it must be a host problem, but i'm running out of ideas...

  5. Todd, try turning off WP Super Cache entirely for a test?

    Johnny, stackechange isn't a 'ticket' system, it's just another support site.

    For both of you: Go through what you changed since the last time it worked :) Even the silly stuff, like 'I changed my widgets.'

  6. JohnnyDuke
    Member
    Posted 1 year ago #

    Hey Mika, thanks for the quick reply. Yes, i know it isn't, but my english isn't good ;)

    I've just find the answer to my problem. :)

    I disabled all the plugins and theme and the problem persisted so i searched more I've found this:

    Issues with old WPMU installs

    If you installed WordPress MU in subfolder/subdirectory (not in root folder on your server >via ftp) and you have problem with image library, where thumbnails and images do not show, >you may need to manually add in rewrite rules for your file directories as follows:

    RewriteRule ^([_0-9a-zA-Z-]+/)?siteN/files/(.+) wp-content/blogs.dir/N/files/$2 [L]
    Put those below the normal call for uploaded files.

    However, this didn't work, i had to replace (or comment) the uploaded files line and change the new one. In the end this is the .htaccess that worked OK for me:

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

    Being 'N' the number of my non-primary site

    So, I guess that for each site, you have to add another line changing the number. Again, I'm not shure it works with more sites.

    Hope this helps

  7. toddhalfpenny
    Member
    Posted 1 year ago #

    Mika, thanks again.

    In the end I followed JohnnyDuke's lead and tested the Rewrite rules by manually setting some. By adding the following I seem to have got a working site again.

    RewriteRule ^(todd/)?files/(.+) wp-content/blogs.dir/2/files/$2 [L]

    Thanks both for your time.
    Todd

Topic Closed

This topic has been closed to new replies.

About this Topic