Skip to content
← Blog

How to Create a Custom 404 Error Page

technical health Mar 1, 2026 3 min read

What the check tests

SiteCurl requests a URL that does not exist on your site and examines the response. It checks two things:

  1. HTTP status code: The server should return 404, not 200 (a “soft 404” that pretends the page exists) or a redirect.
  2. Page content: The response should contain real HTML with at least 100 characters of visible text, not a bare-bones server default.

A proper custom 404 page returns the correct status code and shows visitors a helpful page with navigation, search, or links to popular content.

Why it matters

Visitors hit 404 pages more often than you think. Old bookmarks, mistyped URLs, deleted products, and changed URL structures all lead to missing pages. If those visitors see a generic “404 Not Found” with no navigation, they leave.

A custom 404 page catches them. It says “this page does not exist, but here is how to find what you need.” A search box, links to popular pages, or a list of categories keeps visitors on your site instead of sending them to a competitor.

For SEO, the correct 404 status code matters. A “soft 404” (returning status 200 for a missing page) wastes crawl budget because Google indexes the error page as real content. Returning a proper 404 tells Google to stop crawling that URL.

How to fix it

Create the page

Build a 404 page that matches your site’s design and includes:

  • Your site’s header and navigation (so visitors can browse to a working page)
  • A clear message: “This page does not exist” or “We could not find that page”
  • A search box if your site has search
  • Links to your homepage, popular pages, or main categories
  • No auto-redirect (let the visitor choose where to go)

Configure your server

Nginx:

error_page 404 /404.html;

Apache:

ErrorDocument 404 /404.html

Rails:

Rails handles this automatically. Customize public/404.html or create a dynamic 404 page with a route that catches unmatched URLs.

WordPress:

Create a 404.php template in your theme directory. WordPress uses it automatically.

Avoid soft 404s

Make sure your custom 404 page returns HTTP status 404, not 200. Some CMS configurations accidentally return 200 for custom error pages. Check the status code in your browser’s Network tab or with:

curl -sI https://example.com/this-page-does-not-exist | head -1
# Should show: HTTP/2 404

How to verify the fix

Run a SiteCurl scan and check the technical health section for the custom error page finding. The check confirms both the correct status code and meaningful page content.

Missing pages often result from broken links elsewhere on your site. Fix your 404 page first so visitors have a good experience, then fix the broken links so they never reach the 404 page in the first place.

Start a free trial to check your 404 page and find broken links across your site.

Run a full technical health check

Find broken links, missing tags, redirect chains, and structural problems.

Start 7-Day Studio Trial

No credit card required.

We use cookies to understand how visitors interact with our site. No personal data is sold.