# Customize HTTP error pages

Source: https://zotonic.com/cookbook/1581/customize-http-error-pages

URI: https://zotonic.com/id/1581

Language: en

Override the error template while preserving the response status.

Inspect `error.tpl` and the current error controller in the installed base module. Add a site template override under `priv/templates`, preserving the variables and blocks used by that version.

Keep the error page small and self-contained. It must work when a resource is missing or another part of rendering has failed. Avoid database-heavy widgets, private exception details and assumptions that `id` exists. Offer a homepage link or a simple recovery action.

Test an unknown URL as a logged-out visitor and inspect the HTTP response: the page should still return 404, not 200 or a redirect to a successful page. Test the deployment's generic server-error response in acceptance; do not deliberately crash production to preview it.

Error responses generated by an outer proxy need their own configuration. A Zotonic template cannot customize a response that never reaches Zotonic.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1581?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1581?language=en>)
