Broken Links, 404s and Redirects: Keeping a Site Tidy
Every site that has been online for a while collects old addresses: pages that were renamed, products that were dropped, campaign pages that ended. What the server answers when someone asks for one of those addresses decides whether the visitor lands somewhere useful and whether search engines keep the right page in their results. This guide explains the status codes that matter (301, 302, 404, 410 and the "soft 404"), what a good error page looks like, and how to find problems in Google Search Console. It is based on Google Search Central and MDN documentation, checked on 30 October 2026.
What a status code tells browsers and Google
Every time a browser or crawler requests a page, the server replies with a three-digit HTTP status code before any content. Visitors rarely see it, but it changes what happens next. Google's documentation on how HTTP status codes affect Google's crawlers sums up the groups:
- 2xx (success): the content may be considered for indexing, though a 200 does not guarantee it.
- 3xx (redirection): Google follows the redirect and processes the target page's content instead.
- 4xx (client errors): Google does not index the URL, and URLs already indexed that start returning a 4xx are removed over time.
- 5xx (server errors): Google's crawlers slow down. Already indexed URLs are kept for a while but eventually dropped if the errors continue.
So the goal is simple: every address answers with the code that matches the truth. A live page returns 200, a moved page redirects, a removed page returns 404 or 410, and server errors are fixed rather than left running.
Permanent or temporary: 301, 308, 302 and 307
Google's redirects and Google Search page describes two kinds. With a permanent redirect (HTTP 301 or 308), Google uses the redirect as a signal that the target should be the canonical URL and shows the new address in search results. With a temporary redirect (302, 303 or 307), Google follows it but does not treat it as a canonical signal, so the old address may stay in results. Google's status code page puts it the same way: a 301 is a strong signal and a 302 a weak one. It treats 308 as equivalent to 301 and 307 as equivalent to 302.
In practice:
- A page has a new address for good (renamed, merged, moved to a new domain or to HTTPS): use a 301 or 308. Google says to use permanent redirects when you are sure the redirect won't be reverted.
- You need to send people elsewhere for a while, for example because a service is temporarily unavailable and you want an explanation page: use a 302 or 307, so the original URL keeps its place.
The difference between 301 and 308 is technical. MDN's pages on 301 and 308 explain that after a 301 a browser may change a form submission (POST) into a normal page request (GET), while a 308 forbids changing the method. For ordinary page moves either works; 308 matters for forms and APIs.
Set redirects on the server where you can: Google ranks server-side redirects as the most likely to be read correctly. Its page gives examples for Apache (.htaccess or mod_alias), NGINX and PHP. An instant meta refresh is read as permanent and a delayed one as temporary. JavaScript redirects are a last resort, because Google only sees them if the page renders successfully.
How long should a redirect stay? Google's site move guide says to keep redirects for as long as possible, generally at least a year, and to consider keeping them indefinitely for users. If you are changing many URLs at once, our guide to redesigning without losing search traffic covers building the redirect map.
Removed pages: 404 or 410
When a page is gone and there is no real replacement, do not redirect it to the home page. Return an error code. MDN describes 404 Not Found as "the server cannot find the requested resource", without saying whether that is temporary or permanent. 410 Gone says the resource is no longer available and this is likely to be permanent; MDN's own example is an expired promotion page. If you are not sure whether the removal is permanent, MDN says to use 404.
For Google Search the choice matters less than people think. Google's status code page lists 404 and 410 together and says all 4xx errors except 429 are treated the same way: the URL is removed from the index if it was there, and crawling of it gradually slows. Search Console's help adds that a 404 is not necessarily a problem if the page was removed with no replacement, and that Googlebot will probably keep trying the URL for a while, less and less often.
What does matter is your own links. MDN notes that links leading to a 404 are often called broken or dead links and that their number should be kept down, because they frustrate visitors. When you remove a page, update the menus, footers and articles that pointed to it.
Soft 404s: the error that says "OK"
A soft 404 is a page that tells the visitor it does not exist, or shows nothing useful, while the server still answers 200 (success). Google's crawling troubleshooting page lists typical causes: a missing server-side include, a broken database connection, an empty internal search results page, or JavaScript that failed to load. When Google detects that a page is really an error page, it excludes it from Search and reports a soft 404.
Google's fix depends on the situation:
- The content is gone: return a real 404 or 410.
- The content moved or has a clear replacement: return a 301 to the new page.
- The page is fine but was flagged: it probably did not load properly for Googlebot, was missing resources (for example files blocked by robots.txt, or slow or very large resources) or showed an error message while rendering. Check it with the URL Inspection tool.
A common source on business sites is the "redirect everything missing to the home page" shortcut, or a CMS template that shows "no results" with a 200 code. Both look tidy but hide real errors.
A useful custom 404 page
A bare server error page leaves people stuck. Google's troubleshooting page gives tips for a useful custom 404 page:
- Say clearly that the page cannot be found, in friendly language.
- Keep the same look and navigation as the rest of the site.
- Link to your most popular pages and to the home page.
- Consider giving people a way to report the broken link.
The key technical point: the custom page is only for people, so the server must still send a 404 status with it. If it sends 200, you have created a soft 404. Check this after setting it up by requesting a made-up address and looking at the status code, for example in your browser's developer tools (Network tab).
Redirect chains and loops
Redirects pile up over the years: an old page redirects to a newer one, which later redirects again. Google says its crawlers follow up to 10 redirect hops by default, but its site move guide advises redirecting straight to the final destination and, where that is not possible, keeping chains short, ideally no more than 3 hops and fewer than 5. Chains add delay for users, and not all browsers support long ones. When you add a redirect, also update any older redirects that pointed at the old address so they go straight to the new one.
A loop (A redirects to B, B back to A) breaks the page completely. Loops often appear when HTTP-to-HTTPS or www rules conflict with each other, which is worth testing whenever hosting changes. Our guide to moving a site to a new host covers that switch.
Finding problems in Search Console
The Page indexing report in Google Search Console lists URLs Google knows about and why some are not indexed. The reasons that relate to this guide include:
- Not found (404): fine if the page was removed on purpose; if it moved, add a 301.
- Soft 404: the page shows a "not found" message without a 404 code. Run a live URL inspection and view the tested page to see what Google sees.
- Page with redirect: a non-canonical URL that redirects elsewhere. This is normal for old addresses.
- Redirect error: a chain that is too long, a loop, a redirect URL that grew past the maximum URL length, or a bad or empty URL in the chain.
- Server error (5xx): the server failed when Google asked for the page.
After fixing an issue you can click Validate fix. Google's help says validation typically takes up to about two weeks, and sometimes much longer. For broken links inside your own site, a link checker or crawler run against the live site finds links to pages that no longer exist. Add a monthly look at this report to your routine; our monthly website report guide suggests what else to include.
Checklist
- Moved pages: server-side 301 or 308 to the closest matching new page, kept for at least a year.
- Temporary detours: 302 or 307, removed when the original page is back.
- Removed pages with no replacement: 404 or 410, not a redirect to the home page.
- Custom 404 page with navigation and helpful links, served with a real 404 status.
- No chains: each old URL redirects straight to its final address. No loops between HTTP, HTTPS and www rules.
- Menus, footers and articles updated so they do not link to removed or redirected pages.
- Search Console Page indexing report checked monthly for 404s, soft 404s, redirect errors and 5xx errors.
Frequently asked questions
Should I use a 301 or a 302 redirect?
Use a 301 (or 308) when a page has moved for good; Google then treats the new address as the one to show in search. Use a 302 (or 307) only for a temporary detour, so the original address keeps its place in search results.
Is a 410 better than a 404 for removed pages?
MDN says 410 means the page is gone and likely permanently, and to use 404 if you are not sure. Google's documentation says it treats all 4xx errors except 429 the same way, so for Google Search either code removes the URL over time.
What is a soft 404?
A page that tells visitors it does not exist, or is empty, while the server answers 200 (success). Google excludes such pages from Search and reports them in Search Console. Fix it by returning a real 404 or 410, or a 301 if the content moved.
Should I redirect all missing pages to the home page?
No. Redirect a removed page only when there is a real replacement. Google's advice for removed pages with no replacement is to return a 404 or 410, and sending everything to the home page does not help visitors find what they wanted.
Want someone to keep your site's links, redirects and updates in order? See our website maintenance service, see all our services, or email info@creahive.com.