title: How to throw 404 in DotNetNuke module
body: <p>I want to throw an 404 file not found exception from my module, but every exception is caught by DNN and does not show me my 404.aspx page (only the error page from DNN).</p>
  
  <p>In my web.config I've added:</p>
  
  <pre><code>&lt;httpErrors errorMode="Custom" defaultResponseMode="File"&gt;
    &lt;remove statusCode="404" /&gt;
    &lt;error statusCode="404" prefixLanguageFilePath="" path="/404.aspx" responseMode="ExecuteURL" /&gt;
  &lt;/httpErrors&gt;
  </code></pre>
  
  <p>&amp;</p>
  
  <pre><code>&lt;customErrors mode="On"&gt;
    &lt;error statusCode="404" redirect="~/404.aspx" /&gt;
  &lt;/customErrors&gt;
  </code></pre>
  
  <p>Which work great when opening a page that does not exist. But trying to do the same thing with my module does not give me the same result...</p>
  
  <p>I've tried the following without success:</p>
  
  <pre><code>throw new HttpException(404, "Not Found");
  </code></pre>