Articles

"How-To" Tutorials: How to map .HTM files to use ColdFusion MX

In versions prior to MX 6, you simply used IIS manager to set .htm files to use the CFML processing DLL.  However, in MX 6 and later, you must also make changes to the java engine via a config XML file.

First map .htm to the same .dll as .cfm is set to in IIS, then

Add this to WEB.XML:  (\cf_root\wwwroot\WEB-INF\web.xml)

    <servlet-mapping>
        <servlet-name>CfmServlet</servlet-name>
        <url-pattern>*.htm</url-pattern>
    </servlet-mapping>
   
    <servlet-mapping>
        <servlet-name>CfmServlet</servlet-name>
        <url-pattern>*.htm/*</url-pattern>
    </servlet-mapping>
   
    <servlet-mapping>
        <servlet-name>CfmServlet</servlet-name>
        <url-pattern>*.HTM</url-pattern>
    </servlet-mapping>
       
    <servlet-mapping>
        <servlet-name>CfmServlet</servlet-name>
        <url-pattern>*.HTM/*</url-pattern>
    </servlet-mapping>
   

As of CFMX 7 RC 1, use the following syntax:


 <servlet-mapping id="macromedia_mapping_14">
  <servlet-name>CfmServlet</servlet-name>
  <url-pattern>*.htm</url-pattern>
 </servlet-mapping>
 <servlet-mapping id="macromedia_mapping_15">
  <servlet-name>CfmServlet</servlet-name>
  <url-pattern>*.htm/*</url-pattern>
 </servlet-mapping>

At a minimum you must restart the ColdFusion Application service, but I've also had to restart the entire server sometimes.

Viewed: 26679 as of 03/28/2017

<< Back to Articles