Scheduled broken-link and redirect checks that tell you the moment a link breaks — linkbruno.com
Open the console on almost any website and you'll eventually see it:
Failed to load resource: the server responded with a status of 404 (Not Found) It's a broken link, just not one a human clicked. The page asked the browser to fetch something (a script, a stylesheet, an image, a font, a JSON file, a source map), the browser requested it, and the server said it doesn't exist. Sometimes nothing visible breaks. Sometimes it's the reason the page has no styles, a button does nothing, or a font falls back to Times New Roman.
Here's how to track it down and fix it properly.
Step 1: get the exact URL that failed
The console line alone doesn't say much. Click through to the Network tab and reload with the tab open:
- Filter by status: type
status-code:404in the filter box (Chrome and Edge support this). - Click the failing request. The Headers panel shows the full Request URL.
- The Initiator column (or tab) shows what asked for it: the HTML document, a CSS file, or a line of JavaScript.
The initiator is the important part. A 404 for /fonts/inter.woff2 initiated by main.css means the bug is a url() inside your stylesheet, not your HTML.
From the command line you can confirm it independently:
curl -sI https://www.example.com/assets/app.3f9a1c.js | head -1 Step 2: figure out why the URL is wrong
Compare the URL the browser requested with where the file actually lives. The difference almost always falls into one of these:
A relative path resolved against the wrong base. <script src="js/app.js"> on the page /blog/post-1/ requests /blog/post-1/js/app.js. It worked on the homepage and breaks on every nested page. The fix is a root-relative path (/js/app.js) or a correct <base href>. This is also the classic cause of "works locally, 404 in production" when the production site is served from a subfolder.
The app is deployed under a subpath, but the build doesn't know. If your site lives at example.com/docs/ but was built assuming /, every asset request misses the /docs prefix. Most build tools have a setting for this: base in Vite, basePath and assetPrefix in Next.js, publicPath in webpack, baseurl in Jekyll, baseURL in Hugo.
Hashed filenames from an old build. Modern builds produce files like app.3f9a1c.js. If an HTML page is cached (by a CDN, a service worker or the browser) and the deploy deleted the old hashes, the cached page asks for files that no longer exist. Keep the previous build's assets around for a while after each deploy, and make sure HTML is cached for much less time than hashed assets.
Case sensitivity. Logo.PNG on a Mac works as logo.png. On a Linux server it's a 404. Check the exact casing in the file system against the reference.
A source map that was never uploaded. A 404 for app.js.map only appears when DevTools is open, and it's harmless for users. Either deploy the maps or stop the build from adding //# sourceMappingURL comments.
favicon.ico. Browsers request /favicon.ico even if your HTML never mentions it. A 404 there is noise in logs and monitoring. Put a file there or declare an icon with <link rel="icon">.
One 404 in the console is easy to fix; the next deploy can add ten more on pages you never open. linkbruno.com checks your pages and the assets they load on a schedule, and tells you when an image, script or stylesheet starts returning 404.
Step 3: find every page with the same problem
The page where you noticed the error is rarely the only one. To find others, crawl the site and request every asset URL each page references. A quick shell version for a handful of pages:
for page in / /blog/ /pricing/; do curl -s "https://www.example.com$page" \ | grep -oE '(src|href)="[^"#]+"' | cut -d'"' -f2 \ | while read -r url; do case "$url" in http*) full="$url" ;; /*) full="https://www.example.com$url" ;; *) full="https://www.example.com$page$url" ;; esac code=$(curl -s -o /dev/null -w '%{http_code}' "$full") [ "$code" = 404 ] && echo "$page -> $full" done done It's rough (it won't see assets loaded by JavaScript or referenced from CSS), but it catches the relative-path and subpath bugs quickly. For JavaScript-loaded resources, a headless browser test that listens for failed responses catches the rest:
page.on('response', r => { if (r.status() === 404) console.log(page.url(), '->', r.url()); }); Step 4: stop it shipping again
- Fail the build on missing assets. Most bundlers already fail on a missing import. The risk is in paths written as plain strings in HTML, CSS or Markdown, so add a link check of the built output to CI.
- Keep old hashed assets for a while. Upload new assets before switching HTML, and don't delete the previous release's assets in the same deploy.
- Log 404s for asset paths separately. A 404 on
/assets/is a bug on your side; a 404 on/wp-login.phpis a bot. Splitting them makes the real ones visible. - Check the live site after deploy, not just the build. CDN rules, rewrites and base paths only exist in production.
That last one is where a scheduled check helps: linkbruno.com watches the live site, so the 404s introduced by a CDN rule or a stale cache show up too, not just the ones a build would catch.
Related reading
- Postmortem: the deploy deleted last week's JavaScript bundles, and cached pages kept asking for them
- How to find and fix broken images on a website
- How to fix net::ERR_BLOCKED_BY_CLIENT (when an ad blocker breaks your images, scripts and links)
- The anatomy of a URL, and which part of it broke your link
- When you delete a page on purpose, should it return 404 or 410? Let's argue about it
What's the strangest cause you've found for a console 404? Mine was a CSS file that referenced fonts with ../ and worked everywhere except the one page served from a deeper path.

![Physical AI Hardware Software Co Design — Ch.03: Actuator AI Co Design [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxtsewr6luvpznqila61f.png)
