Linux – Apache returning text/html on some png files

apache-2.2linuxmime

I have an Apache web server that has a sub folder for images.
For some reason, a few of the .png files are returned as text/html and not as image/png.

There is nothing indicating a permission problem and the files return with code 200 and with full size.
I made sure that image/png is set and even tried forcing it with .htaccess

Any idea where to look next?

Edit: looks like an .htaccess configuration problem on a parent directory.

Best Answer

Did you make sure png files are valid image files? If you are on a Linux platform you can try the file command

file somefile.png

That command should return something along the lines of

PNG image data, 318 x 15, 8-bit/color RGB, non-interlaced

You can also try to view the file with a image viewer.