Where do you put the 404 error handling page for a site?
Something like /errors/404.html.twig
? Or is there a prescribed way?
Where do you put the 404 error handling page for a site?
Something like /errors/404.html.twig
? Or is there a prescribed way?
404 errors are handled by the errors
plugin. That plugin provides it’s own error.html.twig
. You can however provide your own, it would just need to be in the templates folder of your theme.
I have that working now. Does errors
handle any other errors beyond 404?
What kind of errors do you have in mind? Are you talking about server errors? Those are now t handled by this plugin, they are handled internally by Grav.
OK, some maybe it should just be 404.html.twig
and 404.md
?
Well, not really because you can use it for custom codes, by setting a http_response_code
value in the page.
I saw http_response_code
but wasn’t sure what it did. Now I know!
It is documented although admittedly not much detail