Custom Adobe ColdFusion 404 error page

If you request a non existent page on a coldfusion site .It will not show up your normal Apache custom 404 page.

A trick to show a custom page ( eg: cferror.cfm ) when a non existant cfm page is accessed is:

Add the following entry to the .htaccess file in your DocumentRoot

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /cferror.cfm?%{REQUEST_URI}

All request to the non existent pages are passed to cferror.cfm page with the requested URL as argument

Posted under coldfusion

This post was written by Anoop Alias on May 7, 2008

Tags:

2 Comments so far

  1. arbilopla July 3, 2008 12:26 pm
  2. insibegem October 10, 2008 3:43 am

    best search engine google

Leave a Comment

Name (required)

Email (required)

Website

Comments

More Blog Post

Next Post: yum sqlite error