ColdFusion 4.5 introduces a site-wide "Missing Template" (404 Error) exception-handling facility. These exception-handling templates can use the full power of CFML to produce highly customized pages.
In the ColdFusion Administrator, click on "Settings" to view the "Server Settings" page. On this page it will allow you to specify a template that will be executed when the ColdFusion Application Server cannot find a template or a request fails. The two options you have are "Missing Template Handler" and "Site-wide Error Handler".
Missing Template Handler lets you specify a default template to execute any time the ColdFusion Application Server cannot find a requested template.
Site-wide Error Handler lets you specify a template to execute any time the ColdFusion Application Server encounters errors while processing a request. Below is an example of how to set these up.
If you have previously enabled IIS's custom 404 error pages for .cfm files, you must disable that option so that the ColdFusion Application Server will be able to process your request and invoke the Missing Template Handler.
To do this in IIS:
The request's CGI, FORM, and URL variables are available to help your template diagnose the failing request. CGI.PATH_INFO and CGI.SCRIPT_NAME contain the name of the requested template. CGI.SERVER_NAME contains the name of the server from which the request was made; this can be helpful if your site hosts multiple virtual domains.
To do this in ColdFusion 4.0.x releases, do the following: