2 – 404 (Page not Found)
When someone follows a broken link, the website should say the page doesn't exist. That answer has to reach both the visitor and the browser. Many websites only do one of the two.
What is tested?
The test fetches an address that is guaranteed not to exist and checks that the response:
- carries status code 404 (rather than 200, which makes search engines index the error page as ordinary content)
- has a sensible
<title> - has an
<h1>heading - contains readable text explaining what happened, and enough of it
- doesn't contain text revealing that something went wrong in some other way than intended
- uses a supported locale
How it affects the score
Every shortcoming lowers the score. The wrong status code weighs heaviest: an error page that answers 200 is a problem for both search engines and visitors, however handsome it looks.
Running the test
python default.py -u https://example.com -t 2 -r
Settings
| Setting | Default | Meaning |
|---|---|---|
tests.page-not-found.override-url |
true |
Lets the test pick the address that should produce a 404 |