1
votes

I have a Windows 2008 server running IIS 7 & Coldfusion 9.0.2 multi instance. I have 3 separate Coldfusion instances, one website per instance. I created unique 404 error pages (404error.cfm) for each website to include that website's header/footer and put the files in their website's root directory. The IIS error page configuration does not appear to be working as I thought it should.

I go into IIS, siteA, error pages, open Edit Custom Error Page for the 404 error, check off Execute a URL on this site. For the URL I enter /404error.cfm. In the featured Settings it doesn't matter which of the 3 items I select. What happens is it runs 404error.cfm at the COLDFUSION ROOT level (JRun4\servers\cfusion\cfusion-ear\cfusion-war\404error.cfm) (I put the file there). Not good because that is not site specific. I modified the CF rootdir 404error.cfm to run the 404error.cfm at the website's root level but it knows nothing about application scope variables nor session scope variables.

How can I get IIS/CF to run 404error.cfm in the website's root directory directly without going thru that CFroot 404error.cfm file?

I hope I explained this so you can follow.

Thanks in advance ~Joe~

1
Probably better suited for Server FaultScott Stroz
I have found that ColdFusion will always check in the WAR for files. If it finds one their (in the WAR) it will process that one instead of the file in your defined IIS web root. And once it finds that file it seems to cache the information. Have you tried stopping and starting the ColdFusion service after you removed the file from the WAR?Miguel-F
I have restarted CF after removing the file from the WAR folder and this is what I get - www.blah.com/blah - custom error page, www.blah.com/blah.htm - customer error page, www.blah.com/blah.cfm - blah.cfm not foundJoe
So if I understand your comment correctly, the custom handler is working for everything except CFM templates. Right? Have you enabled the setting Enable HTTP Status Codes in the ColdFusion administrator? That setting tells the ColdFusion server to return proper http status codes back to IIS.Miguel-F
Darn, This was not checked. I thought I looked at that but it must have been on a different server. When I checked it the custom error page works. Thanks Miguel-F!Joe

1 Answers

1
votes

From the comments

I have found that ColdFusion will always check in the WAR for files. If it finds one their (in the WAR) it will process that one instead of the same-named file in your IIS web root. And once it finds that file it seems to cache the path information to it. So after removing the file from the WAR you need to stop and start the ColdFusion service for it to find the one in the IIS web root.

The other piece to this is that you need to enable the setting Enable HTTP Status Codes in the ColdFusion administrator? That setting tells the ColdFusion server to return proper http status codes back to IIS which in turn will fire off the custom 404 page.