php - 404 route not found exception handling in symfony
I want to create a template for page not found. whenever 404 no route found exception is throwing need to redirect to page. As that is not in proper UI way. I tried steps from this URL
https://symfony.com/doc/current/controller/error_pages.html
I am new to symfony . followed steps until service.yml and created customExceptionController.php and I dont know what to do next step and I am getting error like
How to fix this issue.Please anyone help me to get out of this issue. Thanks in advance
Answer
Solution:
In the
dev
environment, you will always see the default exception page which is meant to ease debugging issues. If you want to see how a certain error page looks like in theprod
environment (because you maybe created a custom template for it), you need to access a special URL that is only available for this purpose in thedev
enviromnent (see https://symfony.com/doc/current/controller/error_pages.html#testing-error-pages-during-development). In your case, this URL is http://127.0.0.1:8000/_error/404