I have a problem on an Apache-based virtual server that I don't understand. A couple of days ago I noticed an unusal number of 500 errors in my logs. My investigations showed they were caused by some JavaScript code that created <img> tags under certain conditions. The 'src' attribute in those tags used relative addressing ('../images') that should point one level lower to the root where my images directory resides. But the server logs showed that the requests that spawned the 500 errors were pointing to '/cgi-bin/images'.
Okay, so I'm baffled. The code involved has remained unchanged for 8 or 9 years, and actually seems to work despite the 500 errors. I started by installing a band-aid server redirect and hard-coding a couple of complete URLs for the images, but I really want to know what's going on here. Why would these problems arise suddenly? Why do they throw 500 errors and not 404s? I would appreciate any advice.