Is it possible to run CF commands inside an HTML file by updating Apache configs/htaccess file? When I searched online, I didn't come across any answers for CF, saw several posting for PHP (perhaps I am not searching for the right terms ... ?).

Specifically, we have CF 6 (I know, don't say it) on Solaris, and Apache 2, and was thinking of using this line:

AddType application/x-httpd-coldfusion .html

so we can use cfinclude inside the HTML files, but this did not work. Your time, ideas and thoughts are much appreciated!



You'd want to add .html to the AddHandler directive in the configuration for your Apache server:

AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf .html

If you run multiple sites on this ColdFusion server, you should probably look to do this just for the site in question and not server-wide. You'd add a lot of load to the server if you have it parse all HTML files looking for CFML instructions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.