Agent Wranglers

WEB-89Recommended

Watch for broken old links

Every week, list the missing addresses people still request, and add a redirect for each one with a replacement.

How to do it

Count 404 answers by path in the server logs each week. Keep IP addresses out of those logs. Ignore obvious probes for software you don't run. Add the old links to the redirect map. Pick each target as Send each old page to its closest new page says.

Examples

Shell example

# Most requested missing paths this week. Log format without IP addresses:
# [$time_local] "$request" $status $body_bytes_sent $request_time
zcat -f /var/log/nginx/site.log* | awk '$(NF-2) == 404 { print $4 }' | sort | uniq -c | sort -rn | head -20

How to check

Run the report weekly. Each of the 20 most requested 404 paths has a redirect entry or is a known probe on an ignore list.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/redirects-and-canonicals/watch-not-found">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.