404 woes

173 views
Skip to first unread message

Tim Welford

unread,
Jun 19, 2015, 3:46:44 AM6/19/15
to lu...@googlegroups.com
Hi, I have recently move several applications from ACF to Lucee, all is well, except for getting 404 pages to work for missing cfm templates

Exception handling works fine.

I'm running IIS 8 on 2k12, tomcat 8, latest lucee
Custom error pages are set in IIS for pages other than .cfm and this works fine, but when I specify the 404.cfm (or 404.htm - i tried both) in the "Missing Template Error (404)" field on Lucee web admin, it doesn't appear to work.
I've tried paths relative to the root, full absolute drive paths both with forward and back slashes (restarting tomcat with each change), nothing seems to make a difference.  There's nothing in application.cfm / application.cfc to override the web content settings.

If a missing template is called, it always falls back to the general error template.

Has anyone got any hints or tips, i'm pulling my hair out!

Thanks

Konstantinos Liakos

unread,
Jun 19, 2015, 7:29:35 AM6/19/15
to lu...@googlegroups.com
Have you tried this in Application.cfc?

 public boolean function onMissingTemplate(required string TargetPage) {
 header statusCode
=404;
 echo
("Page not found");
 
return true;
 
}

Tim Welford

unread,
Jun 19, 2015, 8:46:12 AM6/19/15
to lu...@googlegroups.com
Not yet, the applications I am moving are a mix or .cfc and .cfm (imherited) and I was hoping for a solution that would work on them all.
What page does that actually return though? I need something that is friendly for the user.
Can I use that and "include" the custom 404 page before the return true?

Konstantinos Liakos

unread,
Jun 19, 2015, 9:01:13 AM6/19/15
to lu...@googlegroups.com

Works on Application.cfm also, and yes you can include a custom cfm template.

--
You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/Uw_vIj_WBmA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/5adfa514-8e24-480b-87df-4e5b2cc1dc43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages