?
Solved

Custom 404 Error for .cfm files with IIS

Posted on 2003-12-02
9
Medium Priority
?
1,929 Views
Last Modified: 2013-12-24
I want to have a custom error page (404.cfm) to be loaded when someone types in a bad URL for a coldfusion page.

I am running IIS 5 and Coldfusion 4.5.

I already have IIS set up to display a custom page for .htm for .html files.  When I type in http://www.server.com/notthere.cfm I get a standard 404 error message that reads:

Error Occurred While Processing Request

Error Diagnostic Information

An error has occurred.

HTTP/1.0 404 Object Not Found

Thanks in advance,
Chris
0
Comment
Question by:cbestal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 15

Expert Comment

by:danrosenthal
ID: 9862962
This is a ColdFusion setting. Go to CF Administrator (generally located at "http://www.servername.com/cfide/administrator/index.cfm")

And enter the path to your error page in MISSING TEMPLATE HANDLER under the SETTINGS section.
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9864166
yes that shld do it !

just incase u dont have access to CFADMIN.
u can type in the following in ur "application.cfm"

<CFERROR TYPE="Exception" Template="Custom404Error.cfm" MAILTO="Admin@urdomain.com">
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9866224
>>This is a ColdFusion setting. Go to CF Administrator (generally located at "http://www.servername.com/cfide/administrator/index.cfm")

>>And enter the path to your error page in MISSING TEMPLATE HANDLER under the SETTINGS section.

Dan,

how does that apply to other sites on the same server, will they all receive the same 404 page or can it be set up for each top level directory?

or would anands solution be better in that scenario?

0
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 

Author Comment

by:cbestal
ID: 9867224
>>just incase u dont have access to CFADMIN.
>>u can type in the following in ur "application.cfm"

>> <CFERROR TYPE="Exception" Template="Custom404Error.cfm" MAILTO="Admin@urdomain.com">

I tried to have my hosting company change the settings in the Admin, but they referred me to documentation on CFERROR.  I have tried using CFERROR to take care of this , like anand wrote above, but it doesnt work.

Here is what I have currently in my application.cfm file:

<cfapplication name="CatalogSecurity" sessionmanagement="Yes" setclientcookies="no" sessiontimeout="#CreateTimeSpan(0,0,50,0)#">
<!--- If an error occurs, display this page---->
<CFERROR type="request" template="error.htm">
<CFERROR type="exception" template="error.cfm">

Any more suggestions on how to get this to work using the CFERROR tag?  I am testing this by entering http:/www.servername.com/notthere.cfm where notthere.cfm does not exist.

Thanks.
0
 
LVL 15

Assisted Solution

by:danrosenthal
danrosenthal earned 200 total points
ID: 9870657
> Jester_48 Question: how does that apply to other sites on the same server, will they all receive the same 404 page or can it be set up for each top level directory?

This is a server-wide setting, so yes all sites will call the same error template. Inside the error template you can search for the top level directory and handled the error differently accordingly.


> cbestal comment: I tried to have my hosting company change the settings in the Admin, but they referred me to documentation on CFERROR.  I have tried using CFERROR to take care of this , like anand wrote above, but it doesnt work.

As far as I understand, CFERROR only gets called if there is a ColdFusion error, a missing file does not qualify as a ColdFusion error, so that would be governed by the setting in the CF Administrator I mentioned above. If you do not have access to the server, I don't know of a work-around.

0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9870724
Dan,
thanks fro the info,
look in the CF section for your points
0
 
LVL 17

Accepted Solution

by:
anandkp earned 300 total points
ID: 9872333
Jester :
All the settings on CFADMIN cater to all applications running on ur server. hence to custmise each u'll need to use the tags that allow u to customise each setting thru application.cfm
If u notice - u can set "almost" everything up from application.cfm - just as u can from CFADMIN !

cbestal :
I am not too certain abt <CFERROR type="request" template="error.htm"> ... as ive tried at my place with MX 6.1 & it didnt work either ... i was under the impression that type="request" wld handle the missing page templates !

Can u get hold of settings the settings in IIS [or whatever ur web server is]?
Cos u have a default 404 handler there as well !

If u can change teh path for 404 error in ur web server - it shld help u out [thou keep in mind this wld affect all the sites that are running on that server]

hope that helps !
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9874146
>>All the settings on CFADMIN cater to all applications running on ur server. hence to custmise each u'll need to use the tags that allow u to customise each setting thru application.cfm
If u notice - u can set "almost" everything up from application.cfm - just as u can from CFADMIN !

unfortunately the system architecture requirements at my location require that *almost* every page have its own directory, therefore each dir would need to be updated... and its a lot
0
 

Author Comment

by:cbestal
ID: 9915103
Thanks for the help on this one.  I split the points because this question grew as it went on.  I could not figure out how to get a custom 404 error through <CFERROR> as Dan said, I don't think there is a way.

I used Anands recommendation of setting up IIS to look for .cfm files and then direct to a custom 404 page, and that seems to be working well.

Thanks again,
Chris
0

Featured Post

Plug and play, no additional software required!

The ATEN UE3310 USB3.1 Gen1 Extender Cable allows users to extend the distance between the computer and USB devices up to 10 m (33 ft). The UE3310 is a high-quality, cost-effective solution for professional environments such as hospitals, factories and business facilities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question