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.

This article viewed 34555 times as of 11/21/2024 --- First published on 09/14/2004 --- Last modified on 09/14/2004

<< Back to Articles


Note: Some of our articles were originally published several years ago. There may be errors or newer information. If you find an error, please use the Contact page to let us know. We create these articles as a public benefit to our fellow IT Support and network administration professionals.