Render HTML pages using ColdFusion 8Products affected
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. Apache 2.2.x
Note: You can also use these steps to render pages to any other extension.
Modify the web.xml file byadding the mappings to ColdFusion
- 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
- 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> - Create a duplicate of the code block by pasting it below the original.
- 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".
- Save the file.
- Restart ColdFusion.
Windows 2003 (IIS 6.x)
- In IIS manager, right-click the website and select properties.
- Select the Home Directory tab.
- Click Configuration.
- Select the .cfm extension in the list and click Edit.
- Copy the path in the Executable box to the clipboard.
- Click Cancel.
- Click Add.
- Paste the path in the Executable box.
- Type .html in the Extension box.
- Deselect the Check That File Exists option.
- Click OK.
- Restart IIS.
Apache 2.2.x
- Go to the configuration directory for Apache.
- Edit the httpd.conf file.
- Locate the
"AddHandler jrun-handler"entry. - Add the .html extension at the end of that line. For example:
"AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf .html" - Save the file.
- Restart Apache.
Sun One Web Server 6.1 (iPlanet)
- Go to the configuration directory for Sun One Web Server.
- Edit the obj.conf file.
- Locate the following line and copy it to the clipboard:
ObjectType fn=type-by-exp exp=*.cfm type="jrun-internal/ext"
- Create a duplicate of the code block by pasting it below the original.
- In the duplicate code, modify the
expattribute as follows :
ObjectType fn=type-by-exp exp=*.html type="jrun-internal/ext"
- Save the file.
- Restart the server.
Doc ID
(kb405515)
Last updated
2009-03-17
Products affected
