I want to create a custom search engine(SE) friendly 404 page to handle 404 (Not found) and 404-like content. In theory everything should be done in application.cfc page with a few lines of code.

Here is what I have in mind. CF code needs to recognize the 404s, redirect to SE friendly 404-page.cfm (for example) and then to redirect to the index.cfm!? Also it would be great if the code could recognize both http://www.whatever.com/abc.html and http://www.whatever.com/abc/ as 404s.

The question is, should I use onMissingTemplate()?
Please give me some example or at least tell me where to start.

In the Coldfusion Administrator under SERVER SETTINGS >> SETTINGS >> MISSING TEMPLATE HANDLER you can "Specify the relative path to the template to execute when ColdFusion cannot find a requested template." This is the best way to handle 404 errors.

I want to create a custom search engine(SE) friendly 404 page to handle 404 (Not found) and 404-like content. In theory everything should be done in application.cfc page with a few lines of code.

Here is what I have in mind. CF code needs to recognize the 404s, redirect to SE friendly 404-page.cfm (for example) and then to redirect to the index.cfm!? Also it would be great if the code could recognize both http://www.whatever.com/abc.html and http://www.whatever.com/abc/ as 404s.

The question is, should I use onMissingTemplate()?
Please give me some example or at least tell me where to start.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.