How to redirect to 404 page in zend Framework 2

/ By Arjun / Published on April 8, 2014

The Zend framework automatically does this if the user selected route doesn’t exists.
Although in some situations like getting data from database where the route is valid , but response is 404 (row not exits or may be row has been removed), in that case ,where may be we should have to show 404 page.

Here is line of code which will redirect visitor(user) to 404 page, this will trigger the Zend framework 2 ’s RouteNotFoundStrategy.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x