Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Archive

404 Error Handler?

Started by Muut Archive 12 years ago · 7 replies · 344 views
12 years ago

Where do you put the 404 error handling page for a site?

Something like /errors/404.html.twig? Or is there a prescribed way?

12 years ago

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.

11 years ago

I have that working now. Does errors handle any other errors beyond 404?

11 years ago

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.

11 years ago

OK, some maybe it should just be 404.html.twig and 404.md?

11 years ago

Well, not really because you can use it for custom codes, by setting a http_response_code value in the page.

11 years ago

I saw http_response_code but wasn't sure what it did. Now I know!

👍 1

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1318 9 years ago
Archive · by Muut Archive, 9 years ago
2 915 9 years ago
Archive · by Muut Archive, 9 years ago
2 4024 9 years ago
Archive · by Muut Archive, 9 years ago
1 2900 9 years ago
Archive · by Muut Archive, 9 years ago
3 1082 9 years ago