zend framework 2

How to redirect to 404 page in zend Framework 2

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.

By Arjun

I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.

Leave a Reply

Your email address will not be published. Required fields are marked *