Finding and Fixing Broken Links
How SiteWatch crawls your site for broken links, mixed content, and redirect chains.
What SiteWatch checks
SiteWatch crawls your site starting from the homepage, following internal links up to 2 levels deep. It checks for:
- Broken links: Pages returning 404, 500, or other error codes
- Broken assets: Images, scripts, and stylesheets that return errors
- Mixed content: HTTP resources loaded on HTTPS pages
- Redirect chains: Links that go through more than 2 redirects before reaching the final page
The crawler respects your server with rate limiting (1 request per second for pages, 200ms for assets) and stops after 50 pages or 200 total requests to avoid overloading your server.
How to read your results
- OK (green): No broken links, mixed content, or excessive redirect chains found.
- Warning (amber): Mixed content or redirect chains detected (not user-visible errors, but bad for SEO and security).
- Critical (red): Broken links found (visitors are hitting 404 pages).
The details show: - Pages crawled: How many pages the crawler visited - Broken links: URLs that returned an error, with the status code - Mixed content: HTTP resources on HTTPS pages - Redirect chains: Links with more than 2 hops - Broken assets: Images or scripts returning 404
Common issues and fixes
Broken links (404)
A 404 means the linked page doesn't exist. Common causes:
- A page was deleted or moved without a redirect
- A typo in an internal link
- An external site changed their URLs
How to fix: 1. If the page was moved: add a 301 redirect from the old URL to the new one 2. If the page was deleted: update or remove the link 3. If it's an external link: update it to the new URL or remove it
nginx redirect example:
location = /old-page {
return 301 /new-page;
}
Mixed content
Mixed content means your HTTPS page loads resources (images, scripts, CSS) over insecure HTTP. Browsers may block these resources or show a security warning.
How to fix:
- Update all resource URLs from http:// to https://
- Use protocol-relative URLs: //example.com/image.png (though https:// is preferred)
- Search your HTML/CSS for http:// references:
grep -r "http://" --include="*.html" --include="*.css" --include="*.js" .
If the external resource doesn't support HTTPS, either host a copy on your server or find an alternative.
Redirect chains
A redirect chain is when clicking a link goes through multiple redirects before reaching the final page: A → B → C → D. This is bad because:
- Each redirect adds latency (100-300ms each)
- Search engines may not follow long chains
- Link equity is diluted with each hop
How to fix: Update the original link to point directly to the final destination. If you can't change the source, make sure your redirects point directly to the final URL:
# Bad: chain
/old → /middle → /new
# Good: direct
/old → /new
/middle → /new
Broken assets (images, scripts)
Broken assets mean missing images (showing broken image icons) or missing JavaScript/CSS files (causing visual or functional issues).
How to fix: 1. Check if the file was accidentally deleted from your server 2. Verify the file path is correct (case-sensitive on Linux servers) 3. If it's an external resource, check if the CDN or service is down 4. For bundled assets (Webpack, Vite), rebuild and redeploy
Preventing broken links
- Use relative links for internal pages when possible
- Set up redirects whenever you rename or move a page
- Audit external links periodically — external sites change without notice
- Monitor with SiteWatch — the weekly broken links check catches issues before your visitors do