I know that CF 10 has a number of problems associated with processing 404. This seems to be different from other reports. Details:
- Win2k8 R2 / 64 and IIS7.5
- Update with identical configuration on a separate server. The only difference is CF9 β CF 10. Everything works fine on CF9. Adobe CF9 Lockdown is implemented on the source server, CF10 lock is implemented on this server.
- There is no template handler in CF Admin like /404.cfm, which should translate to the root of Cfusion (c: \ ColdFusion10 \ cfusion \ wwwroot).
- IIS was configured to track failed 404 requests
- IIS 404 processing by default (the CF URL is initially executed, but is removed to simplify debugging).
- The Coldfusion trap, where the template handler is missing, is set by default.
- The root of the IIS site is completely different: c: \ Other \ Place \ SiteRoot \
- The error handler in Sitewide is also installed in CF Admin on the same ColdFusion web server and works as expected.
404.cfm is very simple:
<cfheader statuscode="404" statustext="Not Found"> <h1>404</h1><p>Page not found</p> <cfoutput>#now()#</cfoutput>
Entering the wrong URL [domain] /foo.cfm should display the above pattern. Instead, I get an IIS error screen. An invalid CF template handler is ignored. IIS Request Request Failure Indicates URL
http:
and a detailed view is shown in step 1
RequestURL="http://[mydomain]:80/foo.cfm
I saw a lot of problems with CF10 and 404, but I never forgot that the missing assignment of a template handler is completely ignored. In CF9, this will generate the result as expected. Has anyone seen anything like this?
EDIT:
I also tried to configure this to match the other CF9 server that I have running: added CF mapping to the root directory of the site. Then put the missing template handler in the website root directory, and not in the default CF root directory, and then cfadmin pointed to the missing template handler in the website root using the mapped folder. Same problem. Works great in CF9 and doesn't use CF10 at all.
EDIT2:
As Miguel F noted in the comments, you can turn off the HTML error codes in CF Admin, and this will allow the Missing Template Fire handler ... BUT you will get 200 headers to go with it. Apparently, the cfheader statements are ignored, since I tried to place the cfheader at the beginning and end of the template ... still gives 200. Visually fine, but since SEO is worried it's a disaster. I just looked, and my CF9 servers do not require this parameter to be unchecked for the handlers to work.
EDIT3
The Dana Kowalski solution displays detailed IIS errors for the public, so for the 404, say, added extensions (foo.xyz), the file paths will be shown on the screen. The default behavior is NOT to display detailed errors, except when templates are run locally, as well as displaying custom error pages to visitors. The CF error pattern should work fine with this setting.
POSSIBLE SOLUTION
I backtracked on ColdFusion 9 as part of debugging this issue, and may have found a solution when debugging a separate related issue.