+254725682556 +254725052660 info@ziprof.co.ke
Client Area

General Knowledge

How to Fix a 404 Not Found Error on Your Website

A 404 Not Found error means the web server couldn't find the page or file a visitor, or a search engine, tried to reach. The server itself is working fine: it's just that nothing exists at that specific URL anymore. Here's how to track down why it's happening and fix it.

Common causes of a 404 error

  • The page was deleted, renamed, or moved without a redirect being set up.
  • The link or bookmark has a typo in the URL, or is missing part of the path.
  • A visitor is using an old cached version of a page, a search result, or a bookmark that pointed to a URL that no longer exists.
  • Your site's rewrite rules, commonly stored in a .htaccess file, are missing or misconfigured, so the server can't match the URL to the right page.

How to find out what's broken

  1. Try the exact URL in your browser and check carefully for typos, extra slashes, or the wrong file extension.
  2. Check your site's menu, sitemap, or admin panel to confirm the page still exists, possibly under a different URL.
  3. If the 404 is showing for many pages at once rather than just one, it's more likely to be a rewrite rule or .htaccess problem than a single missing page.

How to fix it

If the page was moved or renamed

Set up a redirect from the old URL to the new one so visitors and search engines land on the right page automatically instead of hitting a dead end.

In cPanel

  1. Log in to cPanel and open Redirects under the Domains section.
  2. Choose the domain, enter the old page's path, and enter the new destination URL.
  3. Click Add to save the redirect.

In DirectAdmin

  1. Log in to DirectAdmin and open Domain Setup, then select your domain.
  2. Use the redirection option to point the old path to the new URL, or add the redirect rule directly to your .htaccess file through File Manager.
  3. Save your changes.

If your .htaccess file is missing or broken

  1. Open File Manager in cPanel or DirectAdmin and go to your site's root folder, usually public_html.
  2. Make sure Show Hidden Files is turned on, since .htaccess starts with a dot and is hidden by default.
  3. Rename the current .htaccess file (for example to .htaccess_old) so you keep a copy, then let your website platform regenerate a fresh one and check whether the error clears.
If you're on WordPress and only posts or pages return a 404 while the homepage loads fine, it's almost always a permalinks issue rather than a missing file. See How to Fix WordPress Posts and Pages Returning a 404 Error for the exact steps.

Give visitors a better experience while you fix it

Even after you've found the cause, it's worth having a proper custom 404 page so anyone who does hit a dead link can still find their way around your site instead of seeing a blank error. See How to Create a Custom 404 Error Page for Your Website for how to set one up.