Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Custom 404 Page Problem -CF 8

Participant ,
Aug 17, 2011 Aug 17, 2011

I'm having problems with a custom 404 page. CF8

I have create a page 404.cfm that I want users to see if they get a 404 error.

I changed the custom 404 page in the CF admin and this custom page works well when the page is an htm page.

But does not work when the page is a cfm page.

of course all of my pages are cfm pages.

How do I make sure my users get the 404.cfm page when there is a 404 error but

any kind of error ...like bad cfml, etc......?

Do I need to add something to the application .cfc??

1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 17, 2011 Aug 17, 2011

You should look into the onMissingTemplate function of Application.cfc.

Adobe's documentation is here: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d2a.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 17, 2011 Aug 17, 2011

You might also consider configuring your 404 error handler at the web server level rather than in ColdFusion.  What web server ( IIS or Apache ) and version are you using?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 17, 2011 Aug 17, 2011

IIS and CF 8

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 18, 2011 Aug 18, 2011

Have you tried configuring your custom 404 error in IIS rather than CF?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 18, 2011 Aug 18, 2011

Yes...my host server set this up.

I set up the CFerror in the application.cfc like this

It seems that my work on this catches all errors except 404 errors.

But I am not getting the error emails though.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 18, 2011 Aug 18, 2011
LATEST

Am I understanding you correctly?  Your host setup custom 404 handling in IIS.  If this is the case I suspect that the CF server never receives a request when a file is not on the server, it has already been handled by IIS.  Therefore no CF logic will, such as emails, will be executed.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources