# Check for broken links (EK20001)

import { Aside, Badge } from '@astrojs/starlight/components';

Working links carry readers to related guides, downloads, and references, so your documentation should point only at reachable targets. EkLine verifies that the links resolve and flags any whose target is unreachable or returns an error status (rule EK20001).

## Why check for broken links in documentation?

Links carry readers to related guides, downloads, and references, and a broken one interrupts the task they came to finish. Link targets drift over time as pages move or get removed, so a link that worked at publish time can rot later. Checking links on every review keeps your documentation trustworthy and your readers on their path.

## What EkLine flags

EK20001 flags a link whose target it can't reach. Common cases include an unreachable host, a target that returns a 404, and an `http://` link where the check requires HTTPS.

The check applies a few rules when it decides whether a link is healthy:

- It treats these HTTP status codes as healthy: 200, 201, 203, 204, 401, and 403.
- It requires links to use HTTPS.
- It skips private and local network addresses.

## How to fix

Correct the link so it points at a reachable target, or remove it if the destination no longer exists. When a link uses `http://`, update it to `https://`.

## FAQ

### How do you fix a broken link?

Correct the link so it points at a reachable target, or remove it if the destination no longer exists. When a link uses `http://`, update it to `https://`.

### Does the check follow links behind authentication?

It may flag a link it can't reach, such as a URL behind a login. When the link is valid but unreachable, keep it and ignore the rule on that line.

## Rule details

| Property | Value |
|----------|-------|
| Rule ID | `EK20001` |
| Category | Links and references |
| Default severity | <Badge text="Error" variant="danger" /> |
| Enabled by default | Yes |

## Ignore this rule

Fix the link before you silence this rule — a broken link is a real defect that reaches your readers. When a link is valid but EkLine can't reach it, such as a URL behind authentication, keep it on one line with an inline comment:

```markdown
<!-- ekline-ignore-next-line EK20001 -- URL requires authentication -->
See the [internal dashboard](https://dashboard.example.com/reports).
```

To disable the rule across your project, add it to the `ignore` list in your [configuration file](/reviewer/configuration/ignoring-rules/#ignore).

## Related rules

- [EK20002](/reviewer/rules/broken-emails/) — Check for broken email addresses