title: What's the most efficient way to redirect a user to the home page if the requested page doesn't exist?
body: <p>I am using ColdFusion 9.1.</p>
  
  <p>I am rebuilding a site from scratch and pointing an existing domain name to it.  The site is still getting a few hits each day and I want to take advantage of that. I want to redirect those page requests to the home page, and not the error that is currently being served.</p>
  
  <p>I am looking ONLY for a ColdFusion solution to move the bad request to the home page.  So, if they request domain.com/BadPage.cfm?QString=XYZ, they will be moved to domain.com/.</p>
  
  <p>I tried using the following method in the Application.cfc, but I couldn't get to work as described.  It seemed to have no effect.</p>
  
  <pre><code>&lt;cffunction name="OnError" access="public" returntype="void" output="true"&gt;
  &lt;cfargument name="Exception" type="any" required="true" /"&gt;
  &lt;cfargument name="EventName" type="string" required="false" default="" /&gt;
  &lt;cfif Exception&gt;
      &lt;cflocation url="http://www.MyDomain.cfom/"&gt;
  &lt;/cfif&gt;
  &lt;!--- Return out. ---&gt; 
  &lt;cfreturn /&gt;
  &lt;/cffunction&gt;
  </code></pre>
  
  <p>In short, what is the simplest ColdFusion means to redirect bad requests?</p>