Skip to content

Custom Status Pages

A custom 404 page improves user experience by providing helpful information and navigation options when a webpage cannot be found.


Custom 404s

Navigating to URLs that your application is unable to resolve will result in a browser default 404 page.

To control this you can configure Altitude to catch all status 404 pages and serve your applications 404 page.

altitude.yaml
vclSnippets:
- name: custom 404
content: |
if (beresp.status == 404 && req.url.path != "/404/" && beresp.http.Content-Length == "0") {
set req.url = "/404/";
restart;
}