Any Website
How to Fix a 404 Not Found Error
Quick Fix
The most common cause of 404 errors is: The URL is mistyped or contains a broken link
Quick solution: Re-check the URL for typos, extra characters, or wrong extensions
A 404 Not Found error is usually caused by one of a handful of configuration problems. Work through the causes below in order - the first ones are the most common.
Common Causes
- The URL is mistyped or contains a broken link
- The page was deleted, renamed, or moved without a redirect
- Incorrect rewrite rules or routing configuration
- Case-sensitive path mismatch on the server
- DNS or caching is serving a stale URL
Step-by-Step Solutions
Solution 1: Confirm It Is Really a 404 (Visitor Steps)
- Re-check the URL for typos, extra characters, or wrong extensions
- Remove everything after the domain and navigate from the homepage
- Use the site's search to find the moved content
- Hard-refresh (Ctrl/Cmd + Shift + R) to bypass a cached redirect
- Try the page in a private window to rule out extensions
Solution 2: Fix Broken Links and Moved Pages (Site Owner)
- Find broken links with a crawler (e.g. Screaming Frog) or the indexing reports in Google Search Console and Bing Webmaster Tools
- Add a 301 redirect from each old URL to its new location
- Update internal links and your XML sitemap to the new URLs
- Never bulk-redirect everything to the homepage - redirect to the closest relevant page
Solution 3: Fix Server Routing and Rewrites
- Apache: confirm mod_rewrite is enabled and .htaccess RewriteRules are correct
- Nginx: check try_files $uri $uri/ /index.html; (or your framework's front controller)
- Single-page apps: route unknown paths to index.html so the client router handles them
- Verify the file exists and the path case matches exactly on Linux
Solution 4: Make 404s Helpful and Monitored
- Create a custom 404 page with search and links to popular content
- Return a real 404 status (not 200) so search engines drop dead URLs - avoid 'soft 404s'
- Track 404s in analytics or logs to catch new broken links early
Prevention Tips
- Watch the server error logs and alert on rising error rates
- Test configuration changes in a staging environment first
- Keep configuration under version control so you can roll back quickly
- Run a configuration test (e.g. nginx -t or apachectl configtest) before every reload