I have been struggling with the most annoying problem for the last few months. I’d find that images on my blog would randomly be broken. Sometimes on a refresh it would be fine, and then BAM, no more image. I would try re-saving the image, re-saving the post, and sometimes it would work…and sometimes it would break something else.

What was so frustrating was that I knew that the images were still there on my server. I knew that the image locations and URLs hadn’t changed. So why were the images randomly becoming broken on my WordPress site?

After one morning where I was checking posts and re-saving the images, I decided to install a WordPress Broken Link Checker plugin. To no surprise, it didn’t find any image links that were broken.

With confirmation that it wasn’t an issue with the file, I dug deeper. My host, BlueHost, has had a lot of small bursts of downtime. Now they are a cheap host, but have been very helpful when I called. However, if I had any sort of high volume traffic on the blog I would most certainly change hosting providers. I searched to see if maybe BlueHost was known to have weird sporadic outages of just certain files. That ended up being a dead end (thankfully.)

I started searching various help forums and most were assisting people who had moved directories and so caused their own broken links, but finally, after searching for so long I stumbled on this thread. In it the contributor described my journey of trying to pin down a similar issue. He suggested that it was a corrupted .htaccess file. I hopped onto my file manager service, checked the option to “show hidden files”, and renamed the .htaccess file to htaccess.txt. I knew that WordPress will automatically create a .htaccess file if one is missing, so I went back to my site and tested.

Thankfully, this fix worked wonderfully and I haven’t seen any more broken images!