Although my system is Apache24 on windows 8.1, i think this problem is more general regardless of systems. I had a working configuration with Apache22 on windows 7 and i did not do any remarkable change when upgrade to apache24 on windows 8.1. When i googled for this problem , i realize there is no general solution. Obviously Apache24 did not see my_file_extension as executable.
Moreover,although i cleared the firefox cache from "c:\users\appdata\local\temp" directory, and remove the file from disc; firefox constantly gave the same file from my file system (namely file:\\c:\users\appdata\local\temp\the-file). And this situation existed for each of my servers (one server on my main machine and server on the other test machine).
So the solution i found (i think more general, at least works for me) is using the "Module mod_actions" directive ("Action" Directive).
To sum up :
My old configuration is like this
#for alias_module
ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"
# for cgi directory
# my_file_extension is ksp
<Directory "c:/Apache24/cgi-bin">
AllowOverride None
Options +ExecCGI
Require all granted
Addhandler cgi-script .ksp
</Directory>
and new configuration is like this
#for alias_module
ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"
# for cgi directory
# my_file_extension is ksp
<Directory "c:/Apache24/cgi-bin">
AllowOverride None
Options +ExecCGI
Require all granted
</Directory>
# then the new directive i added;
# for any file in the server root directory that has an extension .ksp
<Location />
AddHandler ksp .ksp
Action ksp "/cgi-bin/CGI_KSP.exe"
</Location>
In the apache's documentation for Action directive, as an example
Example: File extension
# Files of a particular file extension
AddHandler my-file-type .xyz
Action my-file-type "/cgi-bin/program.cgi"
In this example, requests for files with a file extension of .xyz are handled by the specified cgi script /cgi-bin/program.cgi.
Hope this helps...