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
| Cause | Example |
|---|---|
| File was deleted or moved | Page existed before, now the file is gone |
| URL is misspelled | Typo in a link or the visitor typed the wrong address |
| Permalink not updated after a move | Old URL shared on social media no longer valid |
| WordPress permalink misconfiguration | All posts return 404 after permalink structure change |
| Missing .htaccess file | WordPress rewrite rules rely on .htaccess |
| Wrong document root | Files uploaded to wrong folder |
| Domain points to another service | DNS still resolves to an old host or a different UnderHost server |
Fix for static/HTML sites
- Verify the file exists: log in to cPanel → File Manager → public_html and browse to the expected path
- Check the file name matches the URL exactly-file names are case-sensitive on Linux (
About.html≠about.html) - Ensure the file is in the correct folder-check you haven't accidentally placed it in a subfolder
- 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:
- Log in to WordPress Admin → Settings → Permalinks
- Without changing anything, click Save Changes-this regenerates the .htaccess rewrite rules
- 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.htmlorindex.phpexists inpublic_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
Still troubleshooting?
Use UnderHost tools for quick checks, or open a support ticket when the issue needs account or server access.





















