I`ve moved a Classic ASP app from an old Windows 2003 server to a new server with IIS 10.
It`s working well, and Server-Side Includes work perfectly in .asp files.
However, the app includes some .asp files, containing SSI directives, and those .asp files have been renamed to have a .doc file extension (once processed they open on Word on client side). The SSI directives in those renamed .doc files do not fire.
All the INCLUDE files are .asp`s.
This worked fine on the 2003 server as .doc files had been extension mapped to the asp.dll library.
I`ve been unable to find a way to achieve the same thing on the new IIS 10 server.
If the .doc file is renamed to .asp the SSI's in them work perfectly, so content is fine, it`s the handling of them by IIS when they are named as .doc that eludes me.
I`ve tried adding a Script Map for .doc with identical content to the .asp Script Map, tried adding a Module Mapping for .doc files to the ServerSideInclude Module (partially successful, the includes worked, but the full page source code was visible in the Edge window on the client).
I found references online for how to enable SSI in .htm and .html files, but same guidance doesn`t appear to work for .doc file extension.
Looking for any tips or guidance, or confirmation if it is possible (or not).
As John suggested in his comment, I renamed the fake .doc file back to .asp and amended the original "Response" config at the top..
From this:
Response.Buffer = True
Response.ContentType = "application/vnd.ms-word"
To this:
Response.Buffer = True
Response.ContentType = "application/msword"
Response.AddHeader "Content-Disposition", "attachment; filename=NFA_Damage2.doc"
This worked perfectly, the Includes fired and the doc was offered for download/save as the specified file name and opened in Word.
(I agree this is a better solution than creating a new handler, but on balance I`ll retain the previously posted solution for my specific use case. 1) The app is legacy and has limited life, 2) Config now matches same arrangement as on old server, 3) There are about 25 of those .doc files that would need to be amended, plus the calling asp pages, 4) Adding a handler required no code changes in the app).