IIS custom error script returns script source code
This help article applies to the following situation:
You are running Microsoft IIS.
You have mapped errors -- like 404 Not Found or 500 Internal Server Error -- to a script.
Normal scripts are processed properly by the server, i.e. the *.pl and *.asp handlers appear to be working properly for normal requests.
The errors are correctly mapped to the custom script, but the source code for the script is returned without being processed by the script engine.
Some browsers will start a file download instead of displaying the script source code.
In this situation, the most likely cause of the problem is that your have set up a "File" message type instead of a "URL" message type. All active scripts must use the "URL" type, while HTML pages can use either, and use "File" by default.
The message type selector looks like this:
For more information, refer to How to enable custom error messages on Microsoft IIS. Setting the message type is done in step #7 of those instructions.
"IIS custom error script returns script source code" https://www.xav.com/scripts/guardian/help/1015.html