404 File Or Directory Not Found | Fix It In 10 Minutes

404 File Or Directory Not Found means the server can’t match your URL to a real page, file, or route, so it replies with a not found error.

A 404 looks final. It isn’t. In most cases the server is up, your domain is reachable, and your site is responding. The request just doesn’t map to the right place.

The clean way to fix it is to confirm what’s failing, trace where the URL should land, then repair the single break point. This article gives you a repeatable path you can use after theme changes, migrations, or content edits.

What This Error Means On The Server

When your browser requests a URL, it sends the domain plus a path, like /contact/ or /wp-content/uploads/file.pdf. The web server checks routing rules and the file system. If it can’t find a match, it returns status code 404.

A useful clue is that a 404 is not a crash. The server is answering. That narrows the hunt to routing, redirects, permalinks, or missing files.

  • Edited slugs — A page name changes, old links still point to the previous path.
  • Moved content — A category restructure shifts URLs, menus don’t get updated.
  • Broken rewrite rules — WordPress can’t route pretty permalinks to index.php.
  • Missing media files — Uploads were deleted, renamed, or moved during a site move.
  • Case mismatches — File names differ by capitalization on Linux hosts.

If the whole site is down you’ll see different codes, like 500 or 503. If you’re seeing a 404, the server is alive. That’s good news.

Quick Checks Before You Touch Settings

Start from the outside. These checks take a couple minutes and often point straight at the cause.

Confirm The Exact URL

  • Copy the link — Paste it into a plain text note and look for double slashes, stray spaces, or missing dashes.
  • Load the home page — Remove everything after the domain to confirm the site responds at all.
  • Try http and https — If one works and the other fails, a redirect rule or SSL setting is off.

Check Whether It’s One URL Or Many

One broken URL often means a slug change or a missing redirect. Many broken URLs often means routing rules are broken. This split changes what you do next.

Pattern Likely Cause First Move
One page 404s Slug changed or page deleted Find the page and set a redirect
Most posts 404 Permalinks or rewrite rules Resave permalinks and check server rules
Images and PDFs 404 Moved uploads or wrong path Verify file location and URL casing

Rule Out Local Cache Confusion

  • Open a private window — This bypasses some stored redirects and logged-in routing behavior.
  • Test on mobile data — Switching networks helps confirm whether local DNS is stale.
  • Check a cache plugin — A cached error page can stick around after a fix until you purge it.

Fixing 404 File Or Directory Not Found In WordPress

If your site is WordPress and many posts return 404, start with permalinks. It’s fast, safe, and it refreshes rewrite rules that WordPress depends on.

Reset Permalinks

  • Open permalinks — Go to Settings → Permalinks in wp-admin.
  • Click Save Changes — Don’t change anything, just save to regenerate rewrite rules.
  • Retest a few URLs — Check posts, pages, and category archives to confirm routing is back.

Check Apache .htaccess

  • Find the file — In the WordPress root folder, confirm a .htaccess file exists.
  • Confirm permissions — 644 is common; the file should be readable by the server.
  • Look for duplicates — Multiple WordPress rewrite blocks can fight each other.
  • Restore the default block — Replace custom rules with the standard WordPress rules, then resave permalinks again.

On shared hosting you may not control server modules. If pretty permalinks fail no matter what, use plain permalinks as a short-term workaround while you sort server settings with the host.

Check Nginx Routing

  • Confirm try_files — WordPress needs a rule that sends missing paths to index.php.
  • Reload the service — After config changes, reload Nginx so it uses the new rules.
  • Retest posts and pages — Check several URLs, not just one.

If you don’t have server access, ask your host to apply its WordPress Nginx template for your domain. Hosts usually have a standard config ready.

Fix One-Off Page 404s

  • Search the title — In wp-admin, search for the page or post to confirm it exists.
  • Check the slug — Verify the URL slug matches what your menu and internal links use.
  • Add a 301 redirect — Send the old path to the new path to preserve traffic and bookmarks.

When someone reports 404 File Or Directory Not Found on a single URL, a missing redirect is often the whole story. Fix the redirect, then update internal links so you don’t rely on redirects for your own navigation.

404 File And Directory Not Found Errors After A Site Move

After a migration, a site can show pages but break media, or it can break most URLs at once. That split tells you where to look. If pages break, it’s routing. If media breaks, it’s paths.

Fix Missing Media Files

  • Check the uploads folder — Look in wp-content/uploads for the missing file.
  • Compare domains — If the site URL changed, old posts may still reference the old domain.
  • Run a safe search and replace — Update old URLs in the database using a migration tool that handles serialized data.

Fix File Name Casing Problems

Many servers run on Linux. Linux treats File.jpg and file.jpg as different files. A link that worked on a local machine can fail after deploy.

  • Match the exact filename — Verify capitalization in both the URL and the file system.
  • Check folder names too — A single renamed folder can break a whole set of assets.
  • Correct the source link — Update the link in content or templates so the fix sticks.

Static File 404s That Break Pages

A page can load while looking wrong. Fonts fail. Layout jumps. Buttons stop working. In many cases, the hidden issue is a 404 on CSS, JavaScript, or a font file.

Spot Missing Assets In Your Browser

  • Open DevTools — In Chrome or Edge, press F12, then open the Network tab.
  • Reload the page — Filter by Status and look for 404 rows.
  • Open the missing URL — Click it and check the Request URL and the Referrer.

Fix Plugin And Theme Asset Paths

  • Disable minify — Turn off bundling and minification to rule out broken generated files.
  • Clear build caches — Purge the minify cache so the system rebuilds assets with correct paths.
  • Update the theme or plugin — A missing file can come from an incomplete deploy or a failed update.

If you use a CDN, purge the CDN cache after fixing assets. A CDN can cache a 404 response for a file path that no longer exists, then keep serving that error even after the origin is corrected.

Server Rules That Can Trigger 404

Sometimes the file exists and you still see a 404. That can happen when the domain points at the wrong folder, when a firewall blocks a pattern, or when a proxy rewrites paths.

Confirm The Document Root

  • Check the hosting panel — Verify the domain’s document root is the folder that holds WordPress.
  • Verify subdomains — A subdomain can point to an empty directory if it was created before files were uploaded.
  • Retest the URL — After fixing the root folder, reload a few pages and a few media URLs.

Watch For Firewall Or WAF Blocks

  • Review security logs — Some firewalls return a 404 on blocked requests to hide the block.
  • Test a clean URL — If only certain patterns fail, like query strings, a rule may be too strict.
  • Pause the proxy briefly — If you use a CDN or reverse proxy, test the origin to see whether the error is introduced upstream.

Fix Soft 404 Responses

A soft 404 is when the page displays a not found message but returns a 200 OK status. Search engines may treat those pages as low quality because they waste crawls and confuse indexing.

  • Check the status code — Use the Network tab or a header checker to confirm whether the response is 404 or 200.
  • Fix template logic — Make sure missing content triggers a true 404 response.
  • Keep the error page helpful — Include a search box and a link back to your main sections so visitors can recover fast.