• Resolved Jason

    (@ijas0n)


    Hello, I’ve got a problem with one of my clients sites on a WP Multisite. After uploading images to sub-sites the image is broken, however I can see that it’s uploaded to the server if I check via FTP. Any ideas on how to fix the broken images?

    Some helpful specs to help troubleshoot:

    .htaccess file:

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

    Located in wp-config.php:
    define( 'UPLOADS', ''.'media' );

    also:

    /** Enable Multi-Site options in WordPress. */
    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'mysite.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    Main site images: https://www.mysite.com/media/imagehere.jpg
    Sub site images: https://www.mysite.com/media/sites/2/2013/05/imagehere.jpg

    Let me know if you have other questions that I can help, but I can’t figure this one out. Thanks for your help in advance.

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

    (@ipstenu)

    ?????? Advisor and Activist

    Main site images: https://www.mysite.com/media/imagehere.jpg
    Sub site images: https://www.mysite.com/media/sites/2/2013/05/imagehere.jpg

    Did you move the media folder from wp-contents/uploads? And if so, how?

    Thread Starter Jason

    (@ijas0n)

    Added this to the wp-config.php file:

    define( 'UPLOADS', ''.'media' );

    Thread Starter Jason

    (@ijas0n)

    More info: I had the /media folder specified pre-WP 3.5 when it was available to set in the settings > Media (before I converting the site to a multisite). Then when I converted it to multisite added that line to the wp-config.

    Thread Starter Jason

    (@ijas0n)

    Even when I remove the
    define( 'UPLOADS', ''.'media' );
    it still goes to the media folder (probably from the setting I had prior to 3.5 update.) I’ve checked everything and can’t figure out why?

    Thread Starter Jason

    (@ijas0n)

    RESOLVED!!!

    My host provider (StormOnDemand) helped me figure it out. If anyone out there has an issue like this, here is how to solve it.

    1) Go you your “Sites” section in the network admin
    2) Click the “edit” button on the child site that the images aren’t working
    3) Click the “Settings” tab and scroll down till you find “Upload Url Path”
    4) Make sure the URL is pointing to your upload location https://yoursite.com/uploadfolder
    5) Done

    Hope this helps someone in the future, as it cost me hours of troubleshooting. ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WordPress Multisite Broken Images’ is closed to new replies.