UnderHost
Knowledgebase Docs

Fixing 404 Not Found errors: causes and how to fix

A 404 error means the requested page does not exist on the server. Learn how to check document roots, DNS target, WordPress permalinks, rewrite rules,

On this page

A 404 Not Found error means the web server cannot find the file or page at the requested URL. The server is working, but it cannot match the request to a file, route, or application page. On UnderHost hosting, 404 errors are usually caused by broken links, deleted files, moved content, wrong document roots, WordPress permalink rules, or a domain pointing to the wrong service.

What causes 404 errors

CauseExample
File was deleted or movedPage existed before, now the file is gone
URL is misspelledTypo in a link or the visitor typed the wrong address
Permalink not updated after a moveOld URL shared on social media no longer valid
WordPress permalink misconfigurationAll posts return 404 after permalink structure change
Missing .htaccess fileWordPress rewrite rules rely on .htaccess
Wrong document rootFiles uploaded to wrong folder
Domain points to another serviceDNS still resolves to an old host or a different UnderHost server

Fix for static/HTML sites

  1. Verify the file exists: log in to cPanel → File Manager → public_html and browse to the expected path
  2. Check the file name matches the URL exactly-file names are case-sensitive on Linux (About.htmlabout.html)
  3. Ensure the file is in the correct folder-check you haven't accidentally placed it in a subfolder
  4. Check file permissions: files should be 644, directories 755

Fix for WordPress

Single post/page 404: The page exists but the URL isn't resolving. Reset permalinks:

  1. Log in to WordPress Admin → Settings → Permalinks
  2. Without changing anything, click Save Changes-this regenerates the .htaccess rewrite rules
  3. Test the affected URL

All pages return 404 (except homepage): The WordPress .htaccess file is missing or has incorrect rewrite rules. In File Manager, check public_html/.htaccess-it should contain:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

If the .htaccess file is missing, create it with this content. Then go to Settings → Permalinks and save.

All pages returning 404-non-WordPress

If your entire site shows 404 (not just WordPress), check:

  • The domain is pointing to the correct server/folder
  • An index.html or index.php exists in public_html
  • Files were uploaded to the correct directory (not inside a subfolder named after your domain)
  • The domain's A record resolves to the IP shown in CustomerPanel for the target service

You can verify DNS with the UnderHost IP and DNS tools or from a terminal with dig yourdomain.com A +short.

Custom 404 page

Create a helpful 404 page that guides visitors back to useful content. Add to .htaccess:

ErrorDocument 404 /404.html

Create public_html/404.html with a helpful message. WordPress themes usually have a built-in 404.php template-edit it from Appearance → Theme File Editor.

If the 404 appeared right after an UnderHost open a ticket with the old URL, new URL, domain name, and whether the issue affects one page or the whole site. The team can compare file paths, rewrite rules, and DNS target.

Related: Fixing a 403 Forbidden error | Fixing a 500 Internal Server Error | htaccess guide | WordPress white screen of death

Was this article helpful?

Still troubleshooting?

Use UnderHost tools for quick checks, or open a support ticket when the issue needs account or server access.

Related articles

Back to Troubleshooting