Going out on a bit of a limb here, but I'm guessing that, in addition to the configuration included in your question, this directory is also the target of a ScriptAlias
directive (probably for /cgi-bin
, and possibly in the default Apache configuration rather than in something you've explicitly done). ScriptAlias
says that every file in the directory is a CGI script; see the directive documentation. That's why you have to override that behavior with AddHandler
.
If you want to control which files are executed as CGI scripts using AddHandler
with file extensions like .cgi
, don't use ScriptAlias
. Without ScriptAlias
, the default will be to serve the file out as a resource unless you explicitly say to execute it as a CGI script.