Panos
asked on
coldfusion - File Not Found
Hello experts.
I'm using cf8 and mysql.
How can i show a custom page with a file not found message when a user is typing a wrong address in the url ?
(i'm using application.cfm NOT application.cfc)
I'm using cf8 and mysql.
How can i show a custom page with a file not found message when a user is typing a wrong address in the url ?
(i'm using application.cfm NOT application.cfc)
here is another usefull post
http://www.coldfusionjedi.com/index.cfm/2007/12/5/The-Complete-Guide-to-Adding-Error-Handling-to-Your-ColdFusion-Application
http://www.coldfusionjedi.com/index.cfm/2007/12/5/The-Complete-Guide-to-Adding-Error-Handling-to-Your-ColdFusion-Application
<cffunction name="onError" returnType="void" output="true">
<cfargument name="exception" required="true">
<cfargument name="eventname" type="string" required="true">
<cfset var errortext = "">
<cflog file="myapperrorlog" text="#arguments.exception.message#">
<cfsavecontent variable="errortext">
<cfoutput>
An error occurred: http://#cgi.server_name##cgi.script_name#?#cgi.query_string#<br />
Time: #dateFormat(now(), "short")# #timeFormat(now(), "short")#<br />
<cfdump var="#arguments.exception#" label="Error">
<cfdump var="#form#" label="Form">
<cfdump var="#url#" label="URL">
</cfoutput>
</cfsavecontent>
<cfmail to="bugs@myproject.com" from="root@myproject.com" subject="Error: #arguments.exception.message#" type="html">
#errortext#
</cfmail>
<cflocation url="error.cfm">
</cffunction>
ASKER
ASKER
I will check the last one
ASKER
Is your last post working with application.cfm?
ASKER
Your last post is handling errors.
I have allready in my application.cfm page error handlers but that are not catching the error.
(<cferror type="exception" template="#request.absolut epath#erro rstop.cfm" >
<cferror type="request" template="#request.absolut epath#erro rstop.cfm" >
<cferror type="validation" template="#request.absolut epath#erro rstop.cfm" >)
I have allready in my application.cfm page error handlers but that are not catching the error.
(<cferror type="exception" template="#request.absolut
<cferror type="request" template="#request.absolut
<cferror type="validation" template="#request.absolut
have you set up the error template in the ColdFusion administrator ?
ASKER
No.
I have not set up a missing template handler in administrator.
i want to use shared hosting and have a custom page using my page templates.
Is it not possible?
I have not set up a missing template handler in administrator.
i want to use shared hosting and have a custom page using my page templates.
Is it not possible?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK thank you.
I will look to handle this using the MOD_Rewrite because i'm using Apache.
I will look to handle this using the MOD_Rewrite because i'm using Apache.
ASKER
Thank you.
Regards
Panos
Regards
Panos
http://www.bennadel.com/blog/108-Using-ColdFusion-to-Handle-404-Errors-Page-Not-Found-On-Development-Server.htm
http://www.bennadel.com/blog/286-Handling-404-Errors-in-ColdFusion-via-IIS-Throwing-404-.htm