Error Page

I’ve been getting into trouble for several hours with redirecting to the 404 page in Zend Framework 2. The question in StackOverflow: Before that, I’m using the following code: $this->getResponse()->setStatusCode(404); return; It works fine. However, after I create the 404 error page. I found it won’t redirect you to the error page with the code above. If you want to redirect to the 404 error page, you should use the following code: