← All Status Codes
404
Not Found
⚠️ Client Error Low Risk

📖 What Is HTTP 404?

The server cannot find the requested resource. This could be a temporary or permanent condition. The most commonly encountered error on the web.

🛡️ Security Implications

Attackers use 404 responses to enumerate valid paths, files, and directories. Custom 404 pages should not reveal server technology or internal paths.

🔍 Common Causes

Broken link, deleted page, typo in URL, missing file, incorrect permalink settings, or resource moved without a redirect.

🔧 How to Fix

Check URL spelling. Set up 301 redirects for moved content. Create a custom 404 page. Use tools to find and fix broken links.

🖥️ How to Check

curl -I -o /dev/null -w "%{http_code}" https://example.com

HTTP 404 in depth — what you actually need to know

HTTP 404 Not Found indicates the server cannot find the requested resource. Either the URL never existed, the resource was moved without redirect, the resource was deleted, or the URL is wrong (typo, broken link). 404 is one of the most-encountered HTTP status codes — every broken link on the internet produces one.

404 has SEO and UX implications. From SEO: search engines remove 404 URLs from their index over time; broken-link 404s waste crawl budget. From UX: users encountering 404s get frustrated and may leave the site entirely. Custom 404 pages with helpful navigation (search, popular content, sitemap link) recover some of these users.

From a security perspective, 404 vs 401/403 is an information-disclosure choice. A 404 reveals nothing about whether the path could exist with different access; a 401 or 403 reveals "this exists but you cannot access it". Some applications return 404 for protected resources to obscure existence — security through obscurity that has tradeoffs (less reconnaissance for attackers; less clear errors for legitimate users).

Five real-world scenarios involving HTTP 404

Web reconnaissance — distinguishing real 404 from soft 404

Recon tools (gobuster, ffuf) look for non-404 responses to identify accessible paths. Sites returning 200 for everything (soft 404s) confuse these tools — every path appears accessible. Defenders sometimes intentionally configure this; usually it is just misconfiguration that breaks legitimate tooling.

Broken-link monitoring

Tools (Screaming Frog, Sitebulb, dead-links checkers) crawl sites looking for 404 responses to identify broken links. Maintenance task: fix broken links by updating references or adding redirects. Reduces user frustration and improves SEO.

Bug bounty — 404 vs 403 enumeration

Hunters test for path-based information disclosure: does the site return different status codes for paths that exist (with auth required) vs paths that do not exist? Difference indicates the existence of protected resources, useful for further targeting.

Custom 404 pages for UX recovery

Well-designed 404 pages help recover users who landed on broken URLs. Include search functionality, popular content links, sitemap reference. Some 404 pages are creatively branded ("Page not found, but here are some suggestions"). UX consideration, not security.

Fuzzing for hidden endpoints

Pentest reconnaissance and bug bounty hunting use wordlist fuzzing to find hidden endpoints. Tools send requests for thousands of common paths, identify any non-404 responses as potentially accessible. Standard recon technique.

Common mistakes & edge cases

Soft 404s — returning 200 for not-found pages

Returning HTTP 200 with not-found body content breaks SEO, monitoring, and log analysis. Use proper 404 status code with helpful body content.

Generic 404 page with no recovery options

Default "Not Found" page with no navigation or search loses users who land there. Custom 404 page with search box, popular links, and clear navigation recovers many of these users.

Not setting up redirects when changing URLs

URL changes without redirects produce 404s for all old URLs (in search results, bookmarks, external references). Set up 301 redirects from old URLs to new URLs to preserve UX and SEO value.

Single-page applications returning index.html for all paths

SPA servers configured to "always serve index.html for any path" do not produce real 404s. SPA framework should detect not-found routes and explicitly return 404 status (Next.js, Nuxt, Angular Universal all support this).

Not monitoring 404 rate spikes

Sudden 404 increases indicate broken links (deployment that broke URLs, sitemap changes, removed content). Monitor 404 rate; alert on spikes. Fix promptly to limit user impact and SEO damage.

Returning 404 with detailed file system error messages

Errors like "File /var/www/html/protected/secret.php not found" leak server file paths. Use generic "Page not found" message; keep file paths in logs only.

Frequently Asked Questions about HTTP 404

The server cannot find the requested resource. Either the URL never existed, the resource was deleted or moved, the URL is mistyped, or there is a configuration issue. One of the most common HTTP status codes — every broken link produces one.
When a server returns HTTP 200 with not-found-style page content, instead of properly returning HTTP 404. Search engines call this a soft 404 and penalise it as a quality signal. Always use the proper 404 status code with a helpful error page body.
Apache: ErrorDocument 404 /404.html. Nginx: error_page 404 /404.html;. WordPress: create a 404.php template in your theme. Most CMSes have built-in 404 customisation; the page should include search, navigation, and popular content links.
Search engines remove 404 URLs from their index over time. A few 404s are normal; widespread 404s indicate site quality issues. Use 301 redirects when content moves; use proper 404 (with custom helpful page) when content is deleted; monitor 404 rate for unexpected spikes.
404 = "not found" — could be missing or never existed. 410 = "gone" — explicitly indicates the resource intentionally removed and will not return. Use 410 for deliberately deleted content (helps search engines remove faster); use 404 for general not-found.
404 = resource not found (or appears not to exist). 403 = resource exists but you do not have permission to access it. Some applications return 404 for resources that exist but are unauthorised, to obscure existence (security through obscurity tradeoff).
Crawler tools: Screaming Frog, Sitebulb (paid, comprehensive), Ahrefs/SEMrush site audits (paid), broken-link-checker WordPress plugin (free). Manual: curl -I -L https://yoursite.com/path for individual URL checks. Set up periodic automated crawls to catch new broken links.
Yes — SPAs need to detect when a route does not exist and explicitly set HTTP 404 status. Server-side rendering frameworks (Next.js, Nuxt, Angular Universal) handle this; client-only SPAs need server configuration to return 404 for unknown routes rather than always serving index.html.
Search functionality, links to popular content, link to sitemap or browse-by-category, navigation back to homepage, contact information. Make it easy for users to find what they were looking for or alternative content.
Set up 301 redirects when changing URLs, monitor for broken inbound links from external sites (Google Search Console reports), fix broken internal links found by crawler tools, use proper sitemap.xml so search engines know current URL structure, audit after major site changes.