I have a page that references a JPG image file in a directory outside of the "\media\" and "\theme\img" directories.
If this image doesn't exist, I'd expect the server to return a HTTP 404 response - but it doesn't, it redirects to the index.php page and returns HTTP 200.
That wouldn't be a major issue, except the index.php page does some database intensive work, and I don't want an absent image file to trigger a rendering of index.php, especially since it will never even be seen.
I've looked inside of the .htaccess file (my understanding of htaccess is essentially non-existent), and this behaviour seems to be determined by this line:
### Single entry point ###
RewriteRule .* index.php [L]
But I see some other lines that appear to make special provision for certain types of file a little further up:
### send 404 on missing files in these folders
RewriteCond %{REQUEST_URI} !^/(e107_images|e107_files)/
RewriteCond %{REQUEST_URI} !\.(css|js|swf|mp3|mp4|eot|otf|ttc|ttf|woff|woff2)$ [NC]
If I modify the second line as below, then I get my 404 error (for the JPG file):
RewriteCond %{REQUEST_URI} !\.(css|js|swf|mp3|mp4|eot|otf|ttc|ttf|woff|woff2|jpg)$ [NC]
That's OK, I suppose, I mean I can do that for the image types I need to work with. But I don't know whether this will have any unforseen consequences. Are image files excluded from this group for any particular reason (though, given how many there are, it would be a long list)?
Otherwise, is there something else I'm overlooking that would provide a simpler solution? Thanks in advance