[resolved] Broken Image Links in Media Library (7 posts)

  1. Exme
    Posted 2 years ago #

    Website: tor-fashion.com

    Background: A couple of weeks ago, I transformed my WordPress installation into a multisite (subdomain) with TOR Fashion as the top level domain. A week later, I converted the permalinks from http://tor-fashion.com/2014/01/08/sample-post/ to http://tor-fashion.com/sample-post/. I have added a subdomain site from scratch, but I've only gotten as far as creating the front page.

    Issue: Over the last few days, I've noticed a lot of image links are no longer working. When I check the images in the Media Library, they are there, but they show as broken images too. NOTE: I have nearly 38,000 images in the Media Library.

    The broken images seem to be pretty random. For example, on this post the missing images were uploaded in June 2012, but the Featured Image is also broken and that wasn't uploaded until August 2013. I have had some conflicts with images and posts having the same name, but the Jun 2012 images were spelled incorrectly and the Featured Image has "thumb" in the title, so it's not an issue with name conflicts.

    I can upload new images with no problem, but it does seem like more older images are broken every day.

    Attempted fixes: Yesterday while doing some research into this, I broke my .htaccess file and had to reload it from scratch to fix the site. Unfortunately, that didn't fix my broken images problem. Here is the code I currently have in the .htaccess file:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    # END WordPress

    I have tried turning off all the plugins and resetting the theme to Twenty Thirteen and Twenty Fourteen, but neither worked.

    In the file manager of my hosting account (GoDaddy Linux), there are year and month folders in the wp-content/uploads for 2012 and 2013, but not 2014. All of the files uploaded in 2014 are sitting directly in wp-content/uploads.

    I would appreciate it if anyone had some ideas on how to fix it. Thanks.

  2. So ... I think it's your theme.

    If you go to http://tor-fashion.com/wp-content/uploads/2012/06/ancientexamplarfrontcloseup_thumb.jpg it's a 404 BUT it also redirects to http://tor-fashion.com/?s=ancientexamplarfrontcloseup+thumb.jpg&search_404=1



    THAT is actually the link it SHOULD be.

    Now to be sure, go to /wp-content/uploads/2012/06/ on the server and see if the file is there AND what it's name really is.

  3. Exme
    Posted 2 years ago #

    Thanks, you just pointed me in the right direction for discovering the problem.

    Because I took this site over from someone else, I wasn't aware that GoDaddy has a limit of 1024 files per folder. In most cases, we have about 10x that many in each of the monthly uploads folders. Apparently, the database was having issues accessing all the files and arbitrarily deleted every file from 2012.

    So, I get to pay for a restore and have to figure out a way to break up the files by day so we don't go over the limit again.

    Thanks for your help.

  4. Oh I had forgotten about that particular challenge. *ugh*

    Um... Don't load over 1024 images per site per month? I know, it's not a good option.

  5. Exme
    Posted 2 years ago #

    Yeah, there is no way to prevent that with this site. Especially since WordPress creates 3 versions of every image we post.

  6. Patrick Nommensen
    Multisite Master
    Posted 2 years ago #

    With nearly 38,000 images in the Media Library you may want to find a more advanced hosting solution :)

  7. Exme
    Posted 2 years ago #

    This is my first site and I picked it up from someone else that had set it up on GoDaddy. I honestly don't know anything about other hosting companies.

    I did find a plugin that changes the upload structure to year/month/date/title so we will never have the problem of too many files in one folder again. I'll still have to fix all of the images we currently have on the site.

Topic Closed

This topic has been closed to new replies.

About this Topic