title: How to show customized 404 error page - Symfony2
body: <p>I have this in my controller:</p>
  
  <pre><code>if(some stuff) {
      throw $this-&gt;createNotFoundException('message');
  }
  </code></pre>
  
  <p>When I test it in dev env, I get the Symfony's page telling Exception detected with my text, but I can't test it in prod env :( I run this <code>php app/console cache:clear --env=prod --no-debug</code> and then replace only in the URL <code>app_dev.php</code> with <code>app.php</code> but the toolbar and Symfony's error page stay. </p>
  
  <p>I created this file - <code>app/Resources/TwigBundle/views/Exception/error.html.twig</code>. So will it be rendered in prod?</p>
  
  <p>This is in it:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;title&gt;An Error Occurred: {{ status_text }}&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Oops! An Error Occurred&lt;/h1&gt;
      &lt;h2&gt;The server returned a "{{ status_code }} {{ status_text }}".&lt;/h2&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>where should I give values for <code>status_code</code> and <code>status _text</code>? Or they are taken from the exception?</p>
  
  <p>So in general what I want to do is when a condition in my contoller`s action is true, mine customized error page to be shown in prod env. Did I make it already, and if not, how to make it and how to see the result in prod env?</p>