简体   繁体   中英

Apache serving some images with html content

So I come in to work today to find that some of my images aren't being served into the img elements properly. The path is fine and the requests are returning 200 but the images themselves are blank.

When I open the image address directly in the browser (ie: http://www.example.com/images/image.png , the page loads with a bunch of unstyled html as if I had requested a page, not an image. The html is from pages related to the image, but there is nowhere in that request that I am specifying a page. It's as if the image is being served as an html document instead of an image. Is this a server setting or something?

So I had some dodgy rewrite rules in my .htaccess file which was matching part of the string of the image filename, and internally redirecting to a page but serving it all messed up because of my dodgy .htaccess . Solved the problem by making the .htaccess rules more regulated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM