Create a page that says plainly the address was not found, keeps your normal header and navigation, offers a search box and links to your main sections, and returns a real 404 status code. The status code matters as much as the design, because a friendly error page that answers 200 is treated as a soft 404.
Why it matters
Everyone mistypes addresses and old links break. A helpful error page keeps those visitors on your site instead of sending them back to the search results. A page that returns the correct 404 status also tells search engines the URL does not exist, so it is not indexed.
How to do it
- Write a clear headline such as "We could not find that page" and one short sentence explaining that the link may be old or mistyped.
- Keep your normal site layout: logo, navigation and footer, so the visitor can carry on.
- Add useful routes out: a search box, a link to the home page and links to your most visited sections or products.
- Keep the tone friendly and short. Avoid jokes that hide the message, and avoid automatic redirects to the home page.
- Do not index it. The page should return a 404 status, which is enough on its own for search engines.
- Configure the server so the custom page is shown for missing URLs while the status stays 404. In nginx:
error_page 404 /404.html;
In Apache:
ErrorDocument 404 /404.html
In ASP.NET Core, a status-code pages handler that re-executes a path preserves the 404 status; avoid redirect-based options, which end in a 200. 7. Test with a made-up address:
curl -sI https://example.com/this-page-does-not-exist
The first line must show 404. Also open the address in a browser to check the layout.
8. Make the page work on a phone, with no horizontal scrolling.
9. Check Google Search Console later for "Soft 404" entries, which would show the status is wrong somewhere.
Common mistakes
- Returning 200 for the error page.
- Redirecting every missing URL to the home page.
- Using the error page as a dead end with no links.
- Loading heavy scripts or large images on the error page.
- Letting the error page differ from the rest of the site, which makes it look broken.
Frequently asked questions
Should the 404 page have a noindex tag?
It is not needed when the page returns a 404 status, because search engines already treat the address as missing.
Should I log 404 errors?
Yes. Your server logs and Search Console show which broken addresses people reach. Fix frequent ones with a 301 redirect to the right page.
Can I add a search box?
Yes, a search box is one of the most helpful things on an error page.
Related guides
- Custom 404 page for SEO
- Soft 404 errors and how to fix them
- 410 vs 404 for removed pages
- Broken internal links audit
To test your own error page, Try the free website sample.