This TechNote describe how to render HTM/HTML pages with Adobe ColdFusion 8. Using HTM/HTML pages with ColdFusion code is a safe practice to "hide" the server technology you are using from potential hackers.

Note: You can also use these steps to render pages to any other extension.

Modify the web.xml file byadding the mappings to ColdFusion

  1. In a text editor, open web.xml from one of the following locations:
    • Multi-server config: {jrun_root}\servers\htmlMappings\cfusion.ear\cfusion.war\WEB-INF\web.xml
    • Single server config: {cfroot}\wwwroot\WEB-INF\web.xml
  2. Locate the following block of code and copy it to the clipboard:



    <servlet-mapping id="coldfusion_mapping_6"> <servlet-name>CfmServlet</servlet-name> <url-pattern>*.cfm</url-pattern> </servlet-mapping>
  3. Create a duplicate of the code block by pasting it below the original.
  4. Modify the duplicate code as follows:



    <servlet-mapping id="coldfusion_mapping_14"> <servlet-name>CfmServlet</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping>



    Note: Make sure the ID of the servlet-mapping tag is unique, preferably "coldfusion_mapping_XX".

  5. Save the file.
  6. Restart ColdFusion.

Windows 2003 (IIS 6.x)

  1. In IIS manager, right-click the website and select properties.
  2. Select the Home Directory tab.
  3. Click Configuration.
  4. Select the .cfm extension in the list and click Edit.
  5. Copy the path in the Executable box to the clipboard.
  6. Click Cancel.
  7. Click Add.
  8. Paste the path in the Executable box.
  9. Type .html in the Extension box.
  10. Deselect the Check That File Exists option.
  11. Click OK.
  12. Restart IIS.

Apache 2.2.x

  1. Go to the configuration directory for Apache.
  2. Edit the httpd.conf file.
  3. Locate the "AddHandler jrun-handler" entry.
  4. Add the .html extension at the end of that line. For example: "AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf .html"
  5. Save the file.
  6. Restart Apache.

Sun One Web Server 6.1 (iPlanet)

  1. Go to the configuration directory for Sun One Web Server.
  2. Edit the obj.conf file.
  3. Locate the following line and copy it to the clipboard:



    ObjectType fn=type-by-exp exp=*.cfm type="jrun-internal/ext"



  4. Create a duplicate of the code block by pasting it below the original.
  5. In the duplicate code, modify the exp attribute as follows :



    ObjectType fn=type-by-exp exp=*.html type="jrun-internal/ext"



  6. Save the file.
  7. Restart the server.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy