title: How to handle 404 page on multiple Coldfusion domains under Plesk
body: <p>I am unable to display a custom 404 page for multiple domains running Coldfusion 10 under Plesk.  The issue is that Plesk stopped supporting CF and apparently it is not able to do virtual CF domains. I have several sites running CF.  In the CF Admin a global custom 404.cfm is set for the main domain. The main domain works fine on non-existing pages such as</p>
  <pre><code>mydomain.com/xyz 
  mydomain.com/xyz.htm 
  mydomain.com/xyz.html
  mydomain.com/xyz.cfm
  </code></pre>
  <p>The issue comes with other domains. They have their own custom 404.cfm pages.  But when one enters:</p>
  <pre><code>myseconddomain.com/xyz - ok
  myseconddomain.com/xyz.htm - Not ok
  myseconddomain.com/xyz.html - ok
  myseconddomain.com/xyz.cfm - Not ok
  </code></pre>
  <p>The Plesk Apache is handling the 404 errors for xyz and xyz.html.  404 page displayed correctly.  CF is handling .htm and .cfm extension.  Therefore, when an invalid htm or cfm is entered, <strong>it is displaying the 404 page from the main domain instead of the second domain!</strong></p>
  <p>I found somewhere here that someone suggested using onMissingTemplate.  However, I placed it in the Application.cfm of myseconddomain.com as follows:</p>
  <pre><code>&lt;cfapplication name = &quot;MemberApp&quot; 
  sessionmanagement=yes 
  sessiontimeout=#createtimespan(0,0,30,0)#
  applicationtimeout=#createtimespan(0,0,30,0)#
  scriptProtect=all&gt;
  &lt;cffunction name=&quot;onMissingTemplate&quot; returntype=&quot;boolean&quot; output=&quot;false&quot; &gt;
    &lt;cfargument name=&quot;template&quot; type=&quot;string&quot; required=&quot;true&quot; /&gt;
    &lt;cfinclude template=&quot;/404.cfm&quot; /&gt;
    &lt;cfabort /&gt;
  &lt;/cffunction&gt;   
  </code></pre>
  <p>But it still doesn't work.  What am I missing here?</p>