Skip to main content
February 17, 2011
Question

CFM running from html

  • February 17, 2011
  • 2 replies
  • 1358 views

Hi,

I have a little bit confusion regarding running my cfm files in html

can we embedd cfm code in html files, without rewriting URL

its urgent, plz help ...

This topic has been closed for replies.

2 replies

ilssac
Inspiring
February 17, 2011

To expand on Owain's answer.

In order to get your CFML code executed, the web server (IIS, Apache, etc) needs to know what requests to pass to the ColdFusion Application Server.  By default, the web server is usually configured to pass files with ColdFusion extensons (cfm, cfc, cfr, etc)  to the ColdFusion Applicaiton Server.  It is quite possible to configure any extension you want the web server to pass to ColdFusion, such as htm, html, css, js, etc.  This would allow you to put CFML code into an html file and have it executed by the ColdFusion application server.

Other alternatives you can use so that you do not have to change the URLS of existing HTML files to convert them to using CFML.

1) You could use inline frames inside the HTML page that requests CFML content from another file.

2) You could set up 301 Permanant redirect responses (usually in the web server) for the HTML pages that direct requests to the new CFML pages.

Owainnorth
Inspiring
February 17, 2011

Yup, you'll need to change the ISAPI filter on the IIS website to also pass .html files to CF, as well as the normal .cfm, .cfml etc.

Community Expert
February 17, 2011

In addition to this, you'll have to configure CF to actually respond to those requests passed from IIS:

http://www.pbell.com/index.cfm/2007/3/31/Processing-html-files-using-ColdFusion--on-a-Mac-or-a-PC

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Dave Watts, Eidolon LLC