user1679267 user1679267 - 1 year ago 222
PHP Question

MethodNotAllowedHttpException redirect to home page

is it possible to redirect user to home page when ever MethodNotAllowedHttpException occurs in laravel 5 or which template i should modify to edit the display of MethodNotAllowedHttpException

Answer Source

rfc2616 10.4.6 405 Method Not Allowed

in Laravel if you specify your .env


and create


it will render that file each time an 405 code occurs, i don't think the redirect is possible , but you can always add some javascript into 405 error template for the user to be redirected.

setTimeout(function(){ window.location.href='/'; },10000);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download