A 404 error means a server could not find the page at the requested address. Some 404s are expected, such as when someone mistypes a URL. Others reveal a broken link, a deleted page that still gets visits, or a site migration that left old addresses behind. To fix 404 errors, first find out which kind you have. Then repair the link, restore the page, or redirect visitors to a genuinely relevant destination.
Trying to redirect every missing URL to the homepage may seem like a quick solution, but it can confuse visitors and search engines. A short investigation helps you make a fix that matches the problem.
Fix 404 errors by identifying their source
Start by collecting the URLs that return 404 responses. Look in your website analytics, search performance tools, server logs, or site crawler reports. Your hosting control panel or content management system may also show error logs. Each source provides a different clue: analytics can show whether visitors reach the URL, while server logs can reveal requests from crawlers and other systems.
For each URL, note where it came from, whether it has visitors, and what content used to appear there. Check the address in a browser and compare it with your current site structure. Look for a changed slug, spelling error, missing trailing path, or capitalization difference. Some servers treat uppercase and lowercase characters as different addresses.
Group the errors by cause instead of working through a long list one address at a time. Common patterns include:
- Broken internal links: A link on your own site points to the wrong URL.
- Removed or renamed pages: An old page address no longer has a matching page.
- External links: Another site, email, or social post points to an outdated address.
- Automated requests: Bots request made-up paths, outdated files, or common login locations.
- Configuration problems: A rewrite rule or routing setting prevents valid pages from loading.
That last category deserves attention. If many unrelated pages suddenly return 404s, the issue may be a site-wide routing or server configuration problem, not dozens of missing pages. Check whether the homepage and several known pages load correctly before changing individual URLs.
Choose the right repair for each missing URL
Once you know the cause, match the repair to the visitor’s likely goal. There is no need to redirect every error, and not every missing page should be brought back.
Repair an internal link
If a page on your site links to the wrong address, update the link at its source. This is usually better than adding a redirect for a typo that nobody should be using. Check menus, footers, related-article links, product listings, and older posts. If many pages contain the same wrong address, search your site for it or use a crawler to locate each instance.
Restore a page that should still exist
If an important page was removed by mistake, restoring it at its original URL is often the simplest fix. Check your content trash, revision history, or backup before recreating it. For changes that involve files or a database, review your website backup and restore plan first so you have a way to recover if an edit causes a new problem.
Redirect a moved or retired page
Use a permanent redirect when a page has moved or when a retired page has a clear, closely related replacement. For example, redirect an old service page to the new page for that service. A relevant redirect carries visitors to information that meets the same need, rather than making them start over.
Use a temporary redirect when the move is genuinely temporary. The exact setup depends on your platform and server. Many content management systems offer a redirect feature or a well-maintained extension; web servers can also handle redirects through configuration rules. Avoid installing multiple tools that manage the same rules, since overlapping settings can create redirect loops or unpredictable behavior.
Leave a useful 404 for content with no replacement
If a page was intentionally removed and there is no suitable substitute, let it return a genuine 404 or, if the content is permanently gone, a 410 status. Keep the error page helpful: explain that the page is unavailable and offer a search box, clear navigation, or links to useful sections. Do not send every removed page to your homepage simply to make the error count disappear.
Set up redirects carefully
Before adding a redirect, record the old URL, the destination, and the reason for the change. This simple list makes it easier to review rules later and avoid duplicates. Choose the closest matching destination, then make the redirect in one step. If an old address redirects to a second old address before reaching the final page, update the rule to point directly to the final destination.
Watch for these common redirect problems:
- Redirect loops: Two or more rules send the visitor back and forth.
- Long chains: Several redirects happen before the destination loads.
- Broad rules: A pattern redirects unrelated missing URLs to the same page.
- Wrong destination: The new page does not answer the same question as the old one.
After saving a rule, open the old URL in a private browser window or use a redirect-checking tool. Confirm that it reaches the expected destination and that the final page loads normally. Also test a nearby URL that should not be affected by a broad rule. If the site is behind a cache or content delivery network, clear the relevant cache when old behavior continues to appear.
Check that the fix worked
Test a sample of repaired URLs on desktop and mobile. Confirm that internal links now point directly to the correct address, rather than relying on a redirect for every visit. Check important forms, navigation, and page content on the destination. A redirect that technically works but leads to a missing or unrelated page has not solved the visitor’s problem.
Review error reports again after changes have had time to reach users and crawlers. New 404s can appear as people follow old bookmarks or external links, so the goal is not necessarily to eliminate every request. Focus on errors that affect real visitors, important pages, or links you control. Repeated requests for random paths may come from automated traffic and may not require a redirect.
Prevent avoidable 404 errors
Before changing a page URL, decide whether the address needs to change at all. Short, readable URLs are useful, but changing a stable address just to make it slightly shorter can create extra work. If a URL must change, prepare the replacement page and redirect before publishing the new address.
After a redesign or site migration, crawl the site and compare important old URLs with their new destinations. Update navigation and internal links, and check links in email campaigns or downloadable documents that you control. Keep a small redirect log so future editors can see which addresses have already changed and why.
When a 404 appears, use the evidence to choose a proportionate response. Fix the link you control, restore valuable content, redirect a real move, and leave a clear error page when nothing relevant replaces the old page. That approach keeps the site easier to use without turning every missing URL into a misleading detour.
