Skip to main content
June 21, 2006
Question

??? Create a custom 404 Error page

  • June 21, 2006
  • 4 replies
  • 1697 views
Im running cf mx7 not sure if was setup as a standalone server or running through iis...I think IIS but not 100% sure...

I created a page called error.cfm and put it in my root directory.

then I referred to it in iis under "Custom Errors" > stopped and started the server > refreshed server
Got nothing except the default 404.

then went to the cf administrator

put in the link to the site wide error handler still got nothing.

Can someone please help me out here...I can't see where this is that difficult.


Thanks in advance
Craig
This topic has been closed for replies.

4 replies

BKBK
Braniac
June 24, 2006
Did you enter the URL, /error.cfm , in the Coldfusion Administrator (not forgetting the forward slash)? If you rule that out, then the following might help.

Open the IIS Manager. Navigate to your web site. Right-click on it and select Properties . Click on the tab Home Directory and then on the Configuration button.

For the file types, .CFM, .CFML, .CFC and .CFR, and for jrun_iis6_wildcard.dll, modify the application mappings as recommended by Macromedia. For each file extension, the checkboxes Verify that file exists and Script Engine should both be ticked. Incidentally, note the recommendation, message Type="URL", as the proper setting for your missing-template handler.



Inspiring
June 24, 2006
You're best bet is to make the change to your web server. (iis?) Since the http call hits the webserver and the webserver decides how to return the data, the Web server usually returns the 404 pages.
If I were you, I would make a page to handle the errors in cfm that displays the response codes (404,401,etc) and add it to the site-wide template handler as well as the IIS error page calls.

Maybe someone who is familiar with this setting in IIS can direct you where to update it. I have a vague memory of where the setting was located in Apache.

Hope this helps
June 21, 2006
the "Show Friendly HTTP Error Messages" was unchecked....

I checked it and tested....no difference in the result....


Thanks
Craig
Participating Frequently
June 21, 2006
Are you trying to develop a 404 handler only, if so that would go in the Missing Template Handler not the Site-Wide Error Handler and specified relative to your web-root, example in my case:
\Applications\Production\page_404_Errors.cfm
means to run C:\InetPub\wwwroot\Applications\Production\page_404_Errors.cfm. The web-root being C:\InetPub\wwwroot\
Inetpub\wwwroot is the give away that your using IIS. If you don't have one either you're non-IIS or someone has been playing IIS configuration games.
Be aware that the CF handler ONLY handles missing .cfm's.
Missing .htm's are still handled by IIS and I'm pretty sure they can't (easily at any rate) be directed to a cold fusion page. You could hard-code an .htm version that looks almost identical (no CF variables available) to your Cold Fusion version.
Participating Frequently
June 22, 2006
What I want is a page that displays with my site colors and logo that says "this page could not be found on our servers"
not sure if I can do that with a 404 handeler only. I do have the page created that I want to display.

creating both versions, cfm and htm will not be a problem.

is their a way to check in the cfadministrator if its a standalone or running through iis

Craig

Great question, where does Admin disclose web-server in use? I could not find it. You'd think it would be there somewhere obvious. Closest I could come is the Mappings area. At the bottom, there should be a hard-coded (can't change) logical path for /CFIDE. For the related Directory Path, a default IIS installation would have C:\Inetpub\wwwroot, an Internal CF Webserver would have C:\CFusionMX7\wwwroot\CFIDE, and Apache I have no clue. Are you a hosted site? If so you can give up on handling missing .htm's. Your hosts wouldn't let you mess with the Web Server settings since that would be the default for everybody. If you don't mind a little overhead (application.cfm, CF parsing phase that finds nothing) you could use the .cfm extension even for your straight htms.
Participating Frequently
June 21, 2006
Do you have "Show Friendly HTTP Error Messages" disabled in Internet Explorer? I'm assuming that's the browser you're using to view this custom 404 page...

Internet Options -> Advanced -> Show Friendly HTTP Error Messages