Website troubleshooting guide
How to Fix a 404 Not Found Error
A 404 Not Found error means the server handling a request could not find the requested resource at that URL. The website itself may still be working normally; the problem might affect only one page, an image, a document, or a particular route.
The right fix depends on whether you are visiting someone else's website or managing the affected website. A mistyped address needs a different solution from a missing HTML file, a broken WordPress permalink, or an incorrect redirect.
Quick diagnosis: identify the likely cause
| What you observe | Possible cause | First check |
|---|---|---|
| Only one page returns 404 | Typo, deleted page, changed slug, or missing file | Compare the URL with the published page address |
| Many pages in one directory fail | Directory structure, routing, or rewrite rules | Check the affected paths and server configuration |
| Homepage works but WordPress posts fail | Permalink or rewrite configuration | Review WordPress permalink settings |
| Old URL fails after a site migration | Missing redirect or changed URL structure | Check the old-to-new URL mapping |
| Page works internally but an external link fails | Outdated external link or inconsistent URL | Test the exact destination and update the link if possible |
1. Check the URL carefully
- Read the entire address in the browser's address bar.
- Check spelling, hyphens, punctuation, file extensions, and directory names.
- Remove accidental spaces or extra characters.
- Compare the URL with the link shown in the site's navigation or search results.
- Try opening the site's homepage and navigating to the page from there.
URL paths can be case-sensitive. For example, /Guides/
and /guides/ may point to different paths on some
servers. Do not assume that changing capitalization will always
fix the problem.
2. Determine whether the problem is local or site-wide
Test these three destinations:
- The website's homepage.
- A different page known to work.
- The exact URL returning the 404 response.
If the first two pages work but the third does not, concentrate on that URL, its file, or its application route. If many unrelated pages fail, investigate shared routing rules, deployment changes, or hosting configuration.
You can also open the URL in a private browser window or another browser to rule out a browser-specific issue. However, clearing cache does not recreate a missing server file or repair a broken route.
3. Confirm the actual HTTP response
The message displayed in a browser is not always enough to identify the cause. Website owners can use browser developer tools or a command-line request to inspect the response status.
Using curl
If curl is installed, run this command in a terminal, replacing the example URL with the affected address:
curl -sS -o /dev/null -D - "https://example.com/missing-page/"
Look for a response line such as HTTP/2 404 or
HTTP/1.1 404 Not Found. Servers may use different
HTTP versions, so the exact wording can vary.
To inspect redirects as well, use:
curl -sS -L -o /dev/null -w "Final status: %{http_code}\nFinal URL: %{url_effective}\n" "https://example.com/missing-page/"
The second command follows redirects and reports the final status and destination. A final 404 does not by itself reveal which server or application component generated the response.
4. Fix a missing file on a static website
On a static website, a URL is often served from a file or a configured route. If you manage the site, use your hosting file manager or deployment system to check the expected location.
- Identify the exact path requested by the browser.
- Open the site's document root in the hosting file manager.
- Check whether the expected file or directory exists.
- Confirm the file name, extension, and directory capitalization.
- Check that the latest deployment uploaded the intended files to the correct document root.
- Test the URL again after correcting the file or deployment.
Example: mapping a URL to a file
Suppose the published address is:
https://example.com/guides/setup/
A static host configured to use directory index files might expect a structure like this:
public_html/
└── guides/
└── setup/
└── index.html
This is an example, not a universal rule. Your host may use different routing behavior. Verify the document root and hosting configuration rather than creating duplicate files at random.
5. Repair WordPress permalink errors
If a WordPress homepage works but posts or pages return 404, permalink or rewrite configuration may be responsible.
- Sign in to the WordPress administration dashboard.
- Open Settings → Permalinks.
- Review the selected permalink structure.
- If appropriate, click Save Changes to refresh the rewrite rules.
- Test the affected page again.
Saving permalink settings does not fix every WordPress 404. If the problem continues, check whether the page or post exists, whether its slug changed, and whether a plugin or server rewrite configuration affects routing. Back up important configuration files before editing them.
6. Correct broken internal links
A website can link visitors to an old or incorrect URL even when the intended page exists elsewhere. Review navigation menus, breadcrumbs, buttons, related articles, and links inside older content.
- Record the exact URL returning 404.
- Find the pages that link to that address.
- Determine the correct destination from the published content.
- Update each outdated link.
- Open the updated links in a browser to verify the destinations.
When a site contains many pages, a reputable broken-link crawler can help identify candidates for review. Confirm each result manually where possible: a temporary failure, access restriction, or unusual server response can sometimes be reported as a broken link.
7. Configure redirects when URLs change
If a page has permanently moved, a permanent redirect—commonly HTTP 301 or 308—can guide visitors and search engines to the replacement URL. Choose a destination that serves the same or substantially equivalent purpose.
Before adding a redirect, confirm:
- The destination page exists and returns the intended response.
- The old URL redirects to the correct replacement.
- The destination does not redirect back to the old URL.
- The redirect does not create an unnecessary chain.
- Internal links point directly to the current URL where practical.
8. Inspect server logs and hosting configuration
If the URL and file are correct but the error continues, review the web server or hosting platform's available logs. Compare the requested path and timestamp with the error or access records.
Check these areas where applicable:
- Document root and directory structure.
- File names, extensions, and permissions.
- Rewrite rules and application routing.
- Recent deployments, migrations, or configuration changes.
- Redirect rules and conflicting URL patterns.
- Proxy or CDN behavior if the site uses one.
Do not change several server settings at once. Record the current configuration, make one controlled change, and test the affected URL. If you are unsure which rule is responsible, ask your hosting provider to inspect the relevant logs.
9. Review search engine indexing and the sitemap
If an important page unexpectedly returns 404, inspect its URL in Google Search Console. Confirm whether the page was moved, deleted, accidentally unlinked, or affected by a deployment issue.
- If the page should exist, restore it or fix the underlying problem.
- If it has moved, use a relevant redirect and update internal links.
- If it was intentionally removed and has no replacement, keep the response appropriate to its actual status.
- Keep the sitemap focused on current canonical URLs intended for discovery.
- Remove obsolete URLs from the sitemap when they no longer represent valid pages.
Search engine reports may take time to reflect a change. Submitting a URL for inspection does not repair a server-side 404; fix the page or routing first.
10. Know when a 404 is the correct response
Not every 404 is a fault that needs to be removed. If a requested page genuinely does not exist and there is no suitable replacement, returning 404 is normally appropriate. Search engines can encounter such responses as part of ordinary web crawling.
A problem arises when a valuable page is missing by mistake, a current internal link points to an obsolete address, or a redirect sends users to an irrelevant destination. Fix the cause rather than trying to make every URL return a successful response.
Website owner's final checklist
- Confirm the exact URL and HTTP status.
- Check whether the issue affects one page or many.
- Verify the file or application route exists.
- Review WordPress permalinks if the site uses WordPress.
- Correct broken internal links.
- Test redirects and eliminate loops or unnecessary chains.
- Review server logs if the cause remains unclear.
- Update the sitemap and internal links after a URL change.
- Test the final destination in a fresh browser session.
Frequently asked questions
Does a 404 error mean the entire website is down?
No. A 404 generally means the requested resource was not found. Other pages on the same website may continue to work normally.
Can browser cache cause a 404 error?
A private window or a fresh browser session can help rule out browser-specific behavior. However, a consistent server-side 404 usually requires checking the URL, file, route, or server configuration.
Why does WordPress show 404 when the homepage works?
Possible causes include permalink settings, rewrite rules, a changed slug, or a page that no longer exists. Start by checking the page and permalink settings before changing server files.
Should I redirect every 404 URL to the homepage?
No. Redirect only when a relevant replacement exists. Otherwise, a clear 404 response helps visitors and search engines understand that the requested resource is unavailable.
Will a 404 error automatically harm SEO?
A 404 for a page that genuinely no longer exists is normal. Accidental 404s on valuable pages, broken internal links, and poorly configured redirects can create avoidable usability and search visibility problems.
What should I do if a deleted page still appears in Google?
First confirm whether the page was intentionally removed and whether a relevant replacement exists. Update internal links and the sitemap as needed. Search results may take time to reflect changes.
Related troubleshooting guides
Official technical resources
- Google Search Central: HTTP Network Errors — information about how Google handles HTTP response codes.
- MDN Web Docs: HTTP 404 Not Found — technical explanation of the 404 status code.
- WordPress Documentation — official documentation for WordPress site owners.
External resources are provided for further technical reading. Their content and availability are controlled by their respective publishers.