Note that there are some explanatory texts on larger screens.

plurals
  1. POonMissingTemplate returns blank page, possible conflict with IIS
    primarykey
    data
    text
    <p>I've been trying to set a custom 404 page to show a user-friendly message when the page is missing. That said, my web server (IIS 8) does not process .cfm pages, hence I've written a simple testing script to handle cfm pages onMissingTemplate withing Application.cfc</p> <pre><code>&lt;cffunction name="onMissingTemplate" returnType="boolean" output="true"&gt; &lt;cfargument name="targetPage" type="string" required=true/&gt; &lt;cfset var emails = "abcd@hotmail.com,abcd@gmail.com"&gt; &lt;cftry&gt; &lt;!--- Log all errors. ---&gt; &lt;cflog type="error" text="Missing template: #Arguments.targetPage#"&gt; &lt;!--- Send an email with an error message. ---&gt; &lt;cfmail to="#emails#" from="no-reply@site.com" subject="Missing page: #Arguments.targetPage#" type="html"&gt; #Arguments.targetPage# could not be found. &lt;/cfmail&gt; &lt;cfinclude template="404.cfm"&gt; &lt;cfreturn true /&gt; &lt;!--- If an error occurs, return false and the default error handler will run. ---&gt; &lt;cfcatch&gt; &lt;cfreturn false /&gt; &lt;/cfcatch&gt; &lt;/cftry&gt; &lt;/cffunction&gt; </code></pre> <p>the above code works fine until I change system default page to 404.cfm within IIS settings. On 404.cfm page I only have</p> <pre><code>&lt;cfheader statuscode="404"&gt; </code></pre> <p>and HTML code. As soon as the default page is changed the function returns a blank page! how to sort this out, or handling of .cfm pages should be assigned to the web server as well? Has anyone experienced anything similar?</p> <p><strong>EDIT</strong> As I can see cfheader on 404.cfm is causing the issue for some reason. When I remove it, the function returns the page!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload