Sub topic 1
How a Browser and Crawler Request a URL
Prerequisites
Assume you understand URLs, HTML links, and basic command-line use. A browser and a search crawler both request a URL over HTTP. The server returns a response containing a status code, headers, and usually a body.
Reading Status Codes
The first digit groups the result:
| Code | Meaning | Link-checking interpretation |
|---|---|---|
| 200 | Success | The requested page was returned |
| 301 | Permanent redirect | Use a new URL and update references |
| 404 | Not found | The resource is missing |
| 410 | Gone | The resource was deliberately removed |
| 500 | Server error | The server failed to handle the request |
A 404 can result from a typo, a deleted page, a changed URL, or a broken internal link. A 410 is more explicit when no replacement exists. A 500 usually requires server or application investigation.
Why Links Break
Links break when content moves without a redirect, a slug changes, a domain or protocol changes, or an author enters the wrong path. External links can also fail when another site removes content. Link rot is the gradual growth of these stale links over time.
Redirect Types and When to Use Each
A redirect response includes a Location header. Use 301 for a permanent, cacheable move. Use 302 for a temporary change. 307 is the temporary form that preserves the request method, while 308 is the permanent form that preserves it. For ordinary page links, 301 is usually the practical migration choice.
Redirect Chains and Loops
A redirect chain has several hops, such as /old → /intermediate → /current. Chains add latency and create more failure points. Point the original URL directly to the final destination.
A redirect loop occurs when URLs redirect back to one another. Browsers and crawlers eventually stop following it. Check every Location target, including relative paths and protocol changes.
curl -sIL https://example.com/old-page | grep -iE '^(HTTP|location)'This prints each response status and redirect target, making chains and loops easier to spot.
> callout note > A page that displays “not found” but returns 200 is a soft 404. Crawlers may treat it as a real page, so the server should return 404 or 410.
Exercise
Which status should a permanently moved page normally return?
Show answer
Return 301, or 308 when preserving the request method matters, and point it directly to the final URL.