Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Inside my 404 handler, I added:</p> <pre><code>&lt;cfheader statuscode="404" statustext="Not Found"&gt; &lt;cfheader name="Connection" value="Close"&gt; &lt;!--- this is the fix! ---&gt; </code></pre> <p>Closing the connection seems to work for some reason.</p> <p>And to output the page, I'm doing:</p> <pre><code>&lt;cfcontent reset="Yes" type="text/html"&gt; &lt;cfheader name="Content-Length" value="#Len(fullpage)#"&gt; &lt;cfoutput&gt;#fullpage#&lt;/cfoutput&gt; </code></pre> <p>... where the variable fullpage is the content of the 404 handler.</p> <p>Now I can now consistently return both a 404 status code error AND the entire contents of my error page. However, when a non-ColdFusion page is requested, the CGI values are not correct. Prior to CF10, I could get the requested page by looking at the CGI parameters, specifically CGI.query_string, which used to look like: “404;<a href="http://www.example.com/some/file.html" rel="nofollow">http://www.example.com/some/file.html</a>” Now I’m getting: “404;<a href="http://www.example.com/jakarta/isapi_redirect.dll" rel="nofollow">http://www.example.com/jakarta/isapi_redirect.dll</a>”, which makes it impossible to get the requested page.</p> <p>However, the fact that I can now return an entire document makes this at least a partial workaround to the bug, which is still open (after over a year of CF10 being released)! For now, instead of trying to figure out what page was requested and looking at my sitemap, I'm simply outputting a standard "page not found" error.</p> <p>I should also mention that I'm using the same 404 handler in the onMissingTemplate method in Application.cfc. The requested page is passed into this method, which I then pass to my 404 handler in the Attribute scope, and I call my 404 handler as a cfmodule. So this is a complete solution when it's a ColdFusion page being requested, and only a partial solution when a non-CF page is requested (since we can't determine the requested file).</p>
    singulars
    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.
    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