Wordpress/Image/database issue

apps

#1

Hi folks,

I am having some very strange issues with regards to images not showing at their designated location (URL) or within the wordpress blog. Some times they show, but in most cases they do not. Its very strange.

My first thought is that there is something wrong with the connection to the database, but I really have no clue. In most cases I clicking on the link or image leads to a 404 error. The image is located at that location, though?

Here is a problem post with a number of images in, that are not loading. http://blog.leadcritic.com/featured/lowermybills-celebrates-its-10th-birthday

What is strange is that when I copy and paste the image location into the browser (firefox) it sometimes loads and then subsequently loads on the page.

I ran an Account Test and found no errors.

Can someone help me?

Thanks!!

-Mike


#2

Are you running a caching plugin?

-Scott


#3

Yes, but I did try deactivating for a moment and refreshing the page and the images still did not show. Do you suggest deactivating it for good?


#4

It’s worth taking it out of the loop, which would include cleaning up your .htaccess files. Which plugin is it?

-Scott


#5

Okay, I disabled it and refreshed the browsers cache, but it did not make a difference with the images. The plugin is WP-Cache.

I traced back the actual path through the database to the images and they match what is in the posted URL, but they are not showing. This seems really weird.

Any other suggestions?

Thanks!!


#6

The image URL below is not cached, so it’s something else:
http://blog.leadcritic.com/wp-content/uploads/2009/07/LowerMyBillsCom19992.jpg

If you FTP in, is that image actually in that folder? Did you recently change the uploads path in wp-admin’s Miscellaneous Settings section? By default, it’s wp-content/uploads and probably organized into year/month folders.

-Scott


#7

Were you able to see the image?

Yes, it is actually in that folder. I traced it through each folder and compared it to the URL. I have images in both the /uploads folder as well as the /year/month folders.

that is why I cannot figure this out. I would even consider giving you brief access to the database and/or blog.

let me know what you think.

Thanks for your help!

-Mike


#8

Just another note:

If I copy the URL of the image into its own window, it does show and then, strangely enough, it will show in the post. But only for a short time. If I refresh the page it will disappear.

This is happening to the Logo and a 468x60 ad in the header as well. Sometimes they show and most times they don’t.

WTF is going on??

I feel like it is a connection problem with the database or something.

thoughts?


#9

sorry another note:

The images are showing up in Google Reader (RSS Feed)


#10

I seriously doubt its a database problem.

It seems that after I try to load the article with images, I can try to load the image separately and get a 404 not found page. Then if I browse to the directory containing the images, I see the Apache generated directory index containing the image files. If I traverse up to /wp-content/uploads/2009/ though and back to /wp-content/uploads/2009/07/ the generated directory index is now magically empty - not to mention if I clicked on the image links when I did see them results in a 404.

It’s as if Apache doesn’t want to allow access to the image files and so I’m suspecting an .htaccess issue.

Further testing reveals there is no problem when using http://web-sniffer.net/ to try to request the directory or image files.

Customer since 2000 :cool: openvein.org


#11

Sorry, but what does that mean? Is there a next step to resolve the problem? Is there something I should do with the .htaccess?

Thanks for your help!

-Mike


#12

Temporarily rename .htaccess to .htaccess.old

This will break your blog, but should tell us if .htaccess is preventing the viewing of your images.

Before you do the rename, gather some URLs of broken images. Open them in new windows, if you prefer. Then rename the htaccess and try to load the image URLs.

-Scott


#13

Scott,

You are on the right track! I changed the name to htaccess.old and the images worked as well as other images within the theme that prior to changing were not showing either.

So the problem is with the .htaccess file, but what is the problem and what do I do to fix it?

Your help and assistance is GREATLY appreciated!

-MIke

Here is the content of the .htaccess file:

BEGIN WordPress

RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

END WordPress

deny from 78.46.
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www.)?blog.leadcritic.com.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(www.)?blog.leadcritic.com/ [NC]
RewriteRule .(jpeg|JPEG|jpe|JPE|jpg|JPG|gif|GIF|png|PNG|mng|MNG)$ - [F]


#14

I’m not a .htaccess guru, but what’s with the last set of Rewrite lines? I’m guessing that’s the culprit. Comment out those last four lines and see how it goes.

-Scott


#15

Let’s say your URL is http://example.com/thisisafile.html

All Apache normally has to do is separate take the URL path /thisisafile.html and come up with a file system system path such as /home/username/example.com/thisisafile.html then open that file and send out the contents.

However .htaccess files can be used to use a different method, in particular for the “search engine friendly URL” behavior.

Say your URL now is http://example.com/article/1

Yeah, so there is no directory named “article” and a file named “1”. Apache has been told instead to run the program /home/username/example.com/index.php with parameters view=article and page=1 instead. It knows to do that if the url-path starts with /article/ instead of something else. WordPress itself uses this method.

There are other things such as hotlink prevention, form spam prevention etc that also change what Apache does.

So it would appear that at your site something is causing Apache to not be able to match a url-path directly to an image file, and whatever it is, it is most likely in the .htaccess file.

A simple test would be to copy down a image URL that doesn’t work. Then rename the .htaccess file temporarily to something else. Try to bring up the image. If it comes up just fine, then its the .htaccess file. Also check to make sure you don’t have multiple .htaccess files (not just in the document root)

Also, do the image files have permissions set to 644? If a file doesn’t have public read permission, Apache can’t read it, maybe WordPress is masking that error. Also check the error.log file too.

Customer since 2000 :cool: openvein.org


#16

Scott,

I removed the last four lines and it seems to be working now!!
Thank you very much for your help!

Awesome! I am so pumped now! lol

Thanks again


#17

Nice, thank you for the explanation and it appears you are right! I have edited the htaccess file and it now works

Thanks for your help!

-Mike