Link to home
Start Free TrialLog in
Avatar of Panos
PanosFlag for Germany

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)
Avatar of Brijesh Chauhan
Brijesh Chauhan
Flag of India image

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

<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>

Open in new window

Avatar of Panos

ASKER

Hi brijeshchauhan
I have tried these allready.Nothing happens.
I have no 404 error.
screen.gif
Avatar of Panos

ASKER

I will check the last one
Avatar of Panos

ASKER

Is your last post working with application.cfm?
Avatar of Panos

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.absolutepath#errorstop.cfm">
<cferror type="request" template="#request.absolutepath#errorstop.cfm">
<cferror type="validation" template="#request.absolutepath#errorstop.cfm">)
have you set up the error template in the ColdFusion administrator ?
Avatar of Panos

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?
ASKER CERTIFIED SOLUTION
Avatar of Brijesh Chauhan
Brijesh Chauhan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Panos

ASKER

OK thank you.
I will look to handle this using the MOD_Rewrite because i'm using Apache.
Avatar of Panos

ASKER

Thank you.
Regards
Panos