Developer and Text Tools

Custom 404 and 500 Pages: Turning Dead Ends into Ways Back In

What makes a helpful 404 page, how 500, 403 and 503 pages differ, why soft 404s hurt SEO, and how to set up custom error pages on any host or server.

Saizul Amin
Saizul Amin5 Nov 2026 · 4 min read
Custom 404 and 500 Pages: Turning Dead Ends into Ways Back In

Links break. Pages move, products are discontinued, someone mistypes an address or shares a URL with a missing letter. When that happens, the visitor lands on your error page, and what they see decides whether they keep looking or leave. A default server message in grey text is a dead end. A good custom page is a way back in.

What a helpful 404 page contains

Start by saying clearly that the page could not be found, in plain words rather than technical jargon. Keep your site's look, so visitors know they are still in the right place. Then give them ways forward: a search box, a button to the home page, and three or four links to the places most people want, such as your main product list, the help centre and contact page. A light touch of personality, such as an illustration, is welcome, but the page should still work as navigation first.

Do not redirect every missing page to the home page. It confuses visitors, who think the link worked but landed somewhere unexpected, and search engines treat it as a soft 404 anyway.

Other error pages need different words

A 500 Internal Server Error is your fault, not the visitor's. Say so, apologise, suggest trying again in a few minutes and offer a way to get help if it keeps happening. A search box is pointless here, because the site is struggling. A 403 Forbidden page should explain that access is restricted and suggest signing in or contacting you. A 503 Service Unavailable page is for planned maintenance or overload, and should say the outage is temporary.

The soft 404 trap

The most important technical detail is the status code. A custom error page must still be sent with its error status: 404 for missing pages, 500 for server errors. If a missing page returns your nice error page with status 200, search engines see a normal page. They call it a soft 404, report it in their webmaster tools and may even keep it in results. Adding a noindex robots tag to error pages is a useful second line of defence.

Error pages are shown at whatever address the visitor requested. A missing page at /blog/2019/old-post shows the 404 page at that address, so a relative link such as help would point to /blog/2019/help, which does not exist either. Write every link as a root path starting with a slash, or as a full address. The same goes for the stylesheet and images: link them from the root, or put the CSS inside the page.

For 500 and 503 pages, inline CSS is safer still: when the server is failing, it may not deliver a second file.

Setting them up

Static hosts make the 404 page easy: put a file named 404.html in the root of the published folder and Netlify, Cloudflare Pages, GitHub Pages and Vercel serve it automatically with the right status. On Nginx, error_page directives point each status at its page, with an internal location so the pages cannot be requested directly. On Apache, ErrorDocument lines in the configuration or .htaccess do the same. In an Express app, a final middleware sends 404.html with status 404, and an error handler sends 500.html with status 500. Frameworks such as Next.js have their own not-found and error components.

Building the pages

The Custom 404 Error Page Generator creates matching 404, 500, 403 and 503 pages from one design. Tick the pages you want and edit the heading and message for each, or keep the defaults. Choose a search option for the 404 page: your own site search with its query parameter, or DuckDuckGo or Google limited to your domain. Add a few helpful links, pick an illustration in your accent colour, set the colours and corner rounding, and decide whether the pages follow the visitor's dark mode and whether CSS is shared or inline.

The preview shows each page as it will look. Download a ZIP with the HTML files and stylesheet, and copy the configuration snippet for your server or host.

Test it

After uploading, visit a made-up address on your site and check three things: the page looks right, the links and search work, and the browser's developer tools show status 404 rather than 200. Test the 500 page in a staging environment by triggering an error deliberately.

Summary

A good error page admits the problem, keeps your branding and offers search, home and a few useful links. Match the wording to the error, use root links, inline CSS for server errors, and always send the real status code so you never create soft 404s.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages