Patterns
Error pages
Provide users with clear and helpful error pages when something goes wrong.
Contents
Provide the user with information about the error:
- Error type
- A very short description of the error in present tense such as "Page not found"
- Error details (optional)
- More details about why the error may have occurred
- Suggested next steps
- Some possible next steps that the user can take
Also include the response code from the service to allow the user to pass on helpful information to the supporting team.
Test all links and buttons to make sure they work. Remember to do the hard work to make it simple.
The page should have:
- the error appear as the page title
- contact information, if it exists and helps meet a user need
- a link to another service, if they can use it to do what they came to do
Contact information should either be:
- a link to a specific page that includes numbers and opening times
- include all numbers and opening times
Have clear and concise content and do not use:
- breadcrumbs
- vague, unhelpful words like maintenance, improvements
- technical words like proxy, unauthenticated
- red text to warn people
Page not found
HTML
<h1 class="tna-heading-xl">Page not found</h1>
<p>If you typed the web address, check it is correct.</p>
<p>If you pasted the web address, check you copied the entire address.</p>
<p>If the web address is correct or you selected a link or button, <a href="https://www.nationalarchives.gov.uk/contact-us/">contact us</a> to let us help.</p>
Use a page not found error if someone is trying to view a page that does not exist. This happens if someone:
- selects a link or button that takes them to a page that does not exist
- types or copies a web address for a page that does not exist
- types or copies a web address incorrectly
The server should return a 404 response code.
Follow the advice on Page not found pages on the GOV.UK Design System.
Restricted access
HTML
<h1 class="tna-heading-xl">Restricted</h1>
<p>You are not permitted to view this content.</p>
<p>If you typed the web address, check it is correct.</p>
<p>If you pasted the web address, check you copied the entire address.</p>
<p>If you believe you should be able to view this content, <a href="https://www.nationalarchives.gov.uk/contact-us/">contact us</a> to request access.</p>
Use a restricted access error if someone is trying to view a page or resource that they shouldn’t be allowed to. This can happen if:
- the user is not known
- the user is known but not allowed to view
- the user did not provide login details to a proxy server that handled the request
The server should return a 401, 403 or 407 response code.
Unknown request
HTML
<h1 class="tna-heading-xl">The page you requested cannot be served</h1>
<p>You have requested a page that cannot be served. This could be because the web address you entered or the data you posted was incorrect.</p>
Use a unknown request error if someone is requesting something that doesn't make sense.
For example, the user could manually change a URL from having ?year=2001 at the end to ?year=abc. In this instance, we don't know how to respond to the request because we expect a year to be a number.
If the user uses a URL that is valid but just doesn't have any results (for example ?year=1234567890), use a page not found instead.
A user could also try and visit a URL that was meant to receive form data (using GET rather than a POST). In this instance, the server should respond with an unknown request error.
The server should return a 400, 405 or 406 response code.
Service issue
HTML
<h1 class="tna-heading-xl">There is a problem with the service</h1>
<p>Try again in a few minutes.</p>
<p>If the web address is correct or you selected a link or button, <a href="https://www.nationalarchives.gov.uk/contact-us/">contact us</a> to let us help.</p>
Use a service issue error if someone is trying to view a page that the service is currently unable to render. This can happen if:
- the server is unavailable
- the server experienced an error that wasn’t handled properly
- an unknown issue occurred that isn’t covered by other error messages
The server should also return a response code in the 5xx range.
Follow the advice on Service unavailable pages on the GOV.UK Design System.
Service down
HTML
<h1 class="tna-heading-xl">Sorry, the service is unavailable</h1>
<p>Try again in a few minutes.</p>
Tell the user a service is unavailable on purpose (for example during maintenance). These are also known as shutter pages.
The server should return a 503 response code.
Follow the advice on Service unavailable pages on the GOV.UK Design System.
Rate limited
HTML
<h1 class="tna-heading-xl">Too many requests</h1>
<p>You have requested too many resources in a set timeframe.</p>
<p>Try again in a few minutes.</p>
Use a rate limited error if someone makes too many requests to a service.
This error will mainly be aimed at bots and tools that are used to scrape content from the site, often sending enough requests to slow down parts of our system.
Don’t give details on how many requests in a given timeframe will trigger the error or how long until they are able to make more requests.
The server should return a 429 response code.
Page archived
HTML
<h1 class="tna-heading-xl">Page no longer exists</h1>
<p>A version of the old page can still be viewed in the <a href="https://www.nationalarchives.gov.uk/webarchive/">UK Government Web Archive</a>.</p>
<p>The archive shows the page as it appeared on <strong><time datetime="2026-02-03">3 February 2026</time></strong> (6 months ago).</p>
<div class="tna-button-group">
<a href="#" class="tna-button">
View archived page
</a>
</div>
If the page has been archived, inform the user where the page has moved to and if possible, when the page was last captured.
For pages archived in the UK Government Web Archive, you can check for the information using the CDXJ API. See CDXJ API documentation for more details.
As an example, the API can provide a list of the captures for this design system.
The server should return a 410 response code.
Response codes
This is a suggested list of error pages for each server response code.
| Code | Response | Error page |
|---|---|---|
400 |
Bad Request | Unknown request |
401 |
Unauthorized | Restricted |
403 |
Forbidden | Restricted |
404 |
Not Found | Page not found |
405 |
Method Not Allowed | Unknown request |
406 |
Not Acceptable | Unknown request |
407 |
Proxy Authentication Required | Restricted |
410 |
Gone | Page archived |
414 |
URI Too Long | Unknown request |
429 |
Too Many Requests | Rate limited |
500 |
Internal Server Error | Service error |
502 |
Bad Gateway | Service error |
503 |
Service Unavailable | Service down |
504 |
Gateway Timeout | Service error |
A complete list of responses that are available for error pages can be found on MDN: HTTP response status codes. Use your own judgement when writing error pages for other response codes.