Skip to main content
Known Participant
November 29, 2011
Question

can't configure server side includes with coldfusion

  • November 29, 2011
  • 2 replies
  • 2217 views

Hi,

I've a client that wants to use server side includes (SSI) and coldfusion on the same site.

I can get either to work, but not both at the same time. If it was me, I'd just use cf and cfinclude, but that's not an option.

We're running IIS7.5 on Windows 2008, cf9.01. The web.config is:

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

   

        <staticContent>

            <mimeMap fileExtension=".air" mimeType="application/vnd.adobe.air-application-installer-package zip" />

        </staticContent>

        <handlers>

            <add name="SSINC-htm" path="*.htm" verb="*" modules="ServerSideIncludeModule" resourceType="Either" requireAccess="Script" />

            <add name="SSINC-html" path="*.html" verb="GET,POST" modules="ServerSideIncludeModule" resourceType="File" requireAccess="Script" />

            <add name="JWildCardHandler" path="*" verb="*" modules="IsapiModule" scriptProcessor="D:\ColdFusion9\runtime\lib\wsconfig\1\jrun_iis6_wildcard.dll" resourceType="Unspecified" requireAccess="None" />

            <add name="hbmxmlHandler" path="*.hbmxml" verb="*" modules="IsapiModule" scriptProcessor="D:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />

            <add name="cfswfHandler" path="*.cfswf" verb="*" modules="IsapiModule" scriptProcessor="D:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />

            <add name="cfrHandler" path="*.cfr" verb="*" modules="IsapiModule" scriptProcessor="D:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />

            <add name="cfcHandler" path="*.cfc" verb="*" modules="IsapiModule" scriptProcessor="D:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />

            <add name="cfmlHandler" path="*.cfml" verb="*" modules="IsapiModule" scriptProcessor="D:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />

            <add name="cfmHandler" path="*.cfm" verb="*" modules="IsapiModule" scriptProcessor="D:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />

            <add name="jwsHandler" path="*.jws" verb="*" modules="IsapiModule" scriptProcessor="D:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />

            <add name="jspHandler" path="*.jsp" verb="*" modules="IsapiModule" scriptProcessor="D:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />

        </handlers>

        <defaultDocument>

            <files>

                <add value="index.cfm" />

            </files>

        </defaultDocument>

    <httpErrors existingResponse="PassThrough">

            <remove statusCode="404" subStatusCode="-1" />

            <error statusCode="404" prefixLanguageFilePath="" path="/index.cfm/this-will-force-a-404/" responseMode="ExecuteURL" />

        </httpErrors>

    <security>

        <requestFiltering>               

            <denyUrlSequences>

                <remove sequence="/CFIDE/scripts" />

            </denyUrlSequences>

        </requestFiltering>

    </security>

    </system.webServer>

</configuration>

I've narrowed the problem down to the wildcard handler mapping. If I comment it out, the SSIs work on html pages, but I then get a server error requesting .cfm pages.

With the wildcard mapping in, cfm files run fine, but the html files don't run the includes.

Has anyone any suggestions? There must be something in the wildcard handler that's affecting the html files.

Thanks in advance,

G

This topic has been closed for replies.

2 replies

Community Expert
November 29, 2011

You generally can't have one file processed by two server-side engines. CF and SSI are both server-side engines. The web server can send the file to one engine or the other for processing, but typically not both.

Dave Watts, CTO, Fig Leaf Software

Dave Watts, Eidolon LLC
Known Participant
November 29, 2011

Thanks Dave, but I don't want the .html files processed by both server-side engines - just SSI. For some reason, the html pages are being processed by coldfusion instead. I can't figure out what's wrong with the configuration.

Community Expert
November 29, 2011

This is the set of steps that you'd go through to process non-CF files with CF:

http://www.talkingtree.com/blog/index.cfm/2006/2/17/CF-Custom-File-Extensions

You can reverse these changes to disable that functionality.

Dave Watts, CTO, Fig Leaf Software

Dave Watts, Eidolon LLC
Known Participant
November 29, 2011

Just to add, I've realised that .html files are actually being processed by coldfusion.