404 Not Found Errors

Track down missing pages, fix broken links, and configure custom error pages to keep visitors on your site.

What Is a 404 Error?

A 404 Not Found error is an HTTP status code indicating the server cannot locate the requested resource. The server is running and reachable, but the specific URL the visitor requested does not map to any file or route on the server.

When you or your visitors encounter a 404 page, it means the path in the browser's address bar doesn't correspond to an actual file, directory, or dynamic route on your hosting account.

HTTP Status Code Cheat Sheet

2xx = Success (200 OK) • 3xx = Redirect (301 Moved) • 4xx = Client Error (404 Not Found) • 5xx = Server Error (500 Internal Server Error)

Common Causes

  • Typo in the URL — a misspelled filename or path segment
  • Deleted or moved files — the file existed once but has been removed or relocated
  • Broken internal links — pages on your own site link to URLs that no longer exist
  • Misconfigured .htaccess — rewrite rules pointing to wrong destinations
  • Permalink changes — CMS URL structures updated without redirects
  • Case sensitivity — Linux servers treat Page.html and page.html as different files
  • Incorrect directory permissions — the server can't read the directory to find the file

Step-by-Step Troubleshooting

Compare the URL to the Actual File Location

Log in to your file manager or FTP client and verify the file exists at the exact path shown in the URL. Pay attention to:

  • Correct spelling and capitalization
  • File extension (.html vs .htm vs .php)
  • Subdirectory structure matching the URL path
# Example: URL is https://example.com/blog/my-post.html
# The file should be at: /public_html/blog/my-post.html

ls -la /public_html/blog/

Disable Configuration Files

Rename configuration files that may contain rewrite rules causing the 404. Check the current directory and all parent directories for:

# Rename .htaccess to temporarily disable it
mv .htaccess .htaccess.bak

# Also check for these files:
# php.ini, .user.ini, web.config

After renaming, do a hard refresh (Ctrl+Shift+R) or clear your browser cache. If the page loads, the issue is in that configuration file.

Check Directory Permissions

Directories must be readable by the web server. The standard permission set is 750 for directories and 644 for files.

# Fix directory permissions
find /public_html -type d -exec chmod 750 {} \;

# Fix file permissions
find /public_html -type f -exec chmod 644 {} \;

Upload a Test File

Create a simple test file in the same directory to verify the server can serve files from that location:

<!-- test.html -->
<h1>Test page works!</h1>

If test.html loads but your original file doesn't, the issue is with the file itself — check its encoding, permissions, or content.

Review Rewrite Rules

If you're using URL rewriting, check your .htaccess rules carefully:

# Common .htaccess rewrite for clean URLs
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

WordPress-Specific 404 Fixes

WordPress uses its own permalink system. If you're getting 404s on posts or pages that you know exist:

  1. Go to Settings → Permalinks in WordPress admin
  2. Without changing anything, click Save Changes
  3. This regenerates the .htaccess rewrite rules

If that doesn't work, manually add the WordPress rewrite rules:

# WordPress .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Creating a Custom 404 Page

A custom 404 page improves user experience by guiding visitors back to useful content instead of showing a generic error.

# In .htaccess, add:
ErrorDocument 404 /404.html

Your custom 404.html should include navigation links, a search bar, and links to popular pages to help visitors find what they're looking for.

Pro Tip

Use Google Search Console to monitor 404 errors on your site. It shows you which URLs are returning 404s and where the broken links are coming from, so you can set up 301 redirects.