title: Symfony 2 - Redirect() to Specified Page
body: <p>I am trying to redirect Symfony to another route <code>/404</code> if there is a 404 error. In the <code>ExceptionController.php</code> file, I am looking for the error code 404. When error 404 is present, redirect to <code>my-domain.com/404</code>. I want to redirect my users to another 404 page is because my custom 404 page is from another bundle.</p>
  
  <p>Below is the code I have written. When I go to a non-existing website, I am presented with a 500 server error page instead of my expected redirected 404 page. Am I missing something?</p>
  
  <pre><code>if ($code == '404') {
      return $this-&gt;redirect("/404");
  }
  </code></pre>