# Monitor HTTP status codes and uptime

- Check 46.02 · Automation and quality control · Complementary
- Source: https://checklist-seo-geo.com/en/automation-quality-control/monitor-http-status-codes-uptime
- Automatically monitor the HTTP status codes of your key URLs, redirects and 5xx errors with a script, external probes, server logs and Search Console.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/automation-quality-control/monitor-http-status-codes-uptime.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

Monitoring HTTP status codes means continuously checking that each important URL returns what it should: 200 for pages to be indexed, 301 to the right target for old addresses, 404 or 410 for removed content, and never 5xx. Uptime is the extreme case: the whole site stops responding. Once this check is done, a list of reference URLs is tested several times a day, server errors are counted in the logs, and any deviation triggers an alert.

## Why it matters

The HTTP status code is the first thing a crawler reads. It determines what happens next: a page returning 200 is analyzed, a page returning 404 eventually drops out of the index, a redirect passes its signals on to its target. Google slows down its crawling when it receives 5xx errors, and a robots.txt returning a 5xx error suspends crawling of the whole site for the first twelve hours, according to its documentation.

Status code regressions are frequent and quiet:

- a redirect rule overwritten during a deployment, and hundreds of old URLs falling into 404;
- a key page deleted by mistake in the CMS;
- a firewall or CDN returning 403 or 429 to crawlers while visitors get through;
- an error page served with a 200 code (soft 404), invisible to a probe that only looks at the code;
- an overloaded database causing uncached pages to fail while the cached homepage responds normally.

The crawlers of AI assistants that fetch a page when a question is asked receive the same error, and cannot cite what they could not read.

This guide sets up status code monitoring for the URLs that matter for SEO. The design of uptime probes (frequency, channels, escalation) is covered in [monitor uptime and alerts](https://checklist-seo-geo.com/en/security-infrastructure/monitor-uptime-alerts), and the diagnosis of 5xx errors in [monitor server errors](https://checklist-seo-geo.com/en/http-redirects/monitor-server-errors).

## What it improves

- **Crawling**: fewer 5xx and 403 responses received by crawlers, so less slowing down of crawling.
- **Indexing**: key pages do not disappear from the index after being seen returning errors for several days.
- **Signal transfer**: the redirects from a past redesign stay in place and point to the right target.
- **AI citations**: indirect effect; an inaccessible page cannot be retrieved by an assistant.
- **Rankings**: no direct effect; monitoring prevents losses caused by prolonged errors.

## How to check

Test a few key URLs with a single command:

```bash
for u in https://example.com/ https://example.com/robots.txt https://example.com/sitemap.xml http://example.com/ https://example.com/ancienne-page/; do
  curl -s -o /dev/null -w "%{http_code} %{redirect_url} $u\n" "$u"
done
```

Expected result: `200` for the homepage, robots.txt and the sitemap; `301` to `https://example.com/` for the HTTP version; `301` to the new address for the old page.

Then, in Search Console:

- [Crawl stats](https://search.google.com/search-console/settings/crawl-stats), “By response” breakdown: the share of “Server error (5xx)” should stay close to zero, with no spike.
- [Page indexing](https://search.google.com/search-console/index): the reasons “Server error (5xx)”, “Not found (404)” and “Blocked due to access forbidden (403)” should not contain any important page.

## How to implement

### Before you start

Draw up the reference list: the URLs whose status code must never change without your knowing. Save it in a `controles-http.csv` file, semicolon-separated, one URL per line, with the expected code and, for redirects, the expected target:

```txt
# url;expected code;expected target
https://example.com/;200;
https://example.com/robots.txt;200;
https://example.com/sitemap.xml;200;
https://example.com/categorie/chaussures/;200;
https://example.com/produit/chaussure-trail-x2/;200;
https://example.com/contact/;200;
http://example.com/;301;https://example.com/
https://www.example.com/;301;https://example.com/
https://example.com/ancienne-categorie/;301;https://example.com/categorie/chaussures/
https://example.com/promo-noel-2024/;410;
https://example.com/page-qui-n-existe-pas-9f3c/;404;
```

What to put in it:

| URL type | Expected code | Why |
|---|---|---|
| Homepage, categories, pages that generate traffic or leads | 200 | Pages to protect first |
| robots.txt and sitemaps | 200 | An error blocks or slows down crawling |
| HTTP and www (or non-www) versions | 301 to the canonical version | See [standardize HTTP/HTTPS and www/non-www](https://checklist-seo-geo.com/en/indexing-canonicalization/standardize-http-https-www-non-www) |
| Old URLs with high traffic or external links | 301 to their equivalent | A redesign's redirects are often lost at the next deployment |
| Made-up URL | 404 | If it returns 200, the site produces soft 404s, see [fix soft 404s](https://checklist-seo-geo.com/en/indexing-canonicalization/fix-soft-404s) |
| Uncached dynamic page (internal search, recent product page) | 200 | Reveals a database failure that the cached homepage would hide |

Twenty to fifty lines are enough for most sites. Exhaustive checking of every URL is the job of the [scheduled crawl](https://checklist-seo-geo.com/en/automation-quality-control/schedule-automated-crawls).

### The check script

This Bash script uses only `curl`. It reads the file, compares the actual code and target with the expected values, and exits with an error if it finds a mismatch. The expected code accepts several values separated by `|`, for example `301|308`. Save it as `/srv/controles/controle-http.sh`:

```bash
#!/usr/bin/env bash
# Compares each URL's HTTP status code and redirect target with the expected values.
set -u
FICHIER="${1:-controles-http.csv}"
UA="Mozilla/5.0 (compatible; controle-http/1.0)"
ECARTS=0

while IFS=';' read -r url attendu cible || [[ -n "$url" ]]; do
  [[ -z "$url" || "$url" == \#* ]] && continue
  resultat=$(curl -s -o /dev/null -m 20 -A "$UA" -w '%{http_code};%{redirect_url}' "$url")
  code="${resultat%%;*}"
  redirection="${resultat#*;}"

  if [[ ! "$code" =~ ^($attendu)$ ]]; then
    echo "CODE   $url: $code instead of $attendu"
    ECARTS=$((ECARTS + 1))
  elif [[ -n "$cible" && "$redirection" != "$cible" ]]; then
    echo "TARGET $url: ${redirection:-none} instead of $cible"
    ECARTS=$((ECARTS + 1))
  fi
done < "$FICHIER"

echo "$(date '+%F %T'): $ECARTS mismatch(es)."
[[ $ECARTS -eq 0 ]]
```

The script does not follow redirects: it checks the first response, which also reveals chains (an old URL that redirects to another redirect). A `000` code means the server did not respond within 20 seconds or the connection failed.

Schedule it every 15 minutes with cron (`crontab -e`), with an email only when there is a mismatch:

```txt
*/15 * * * * cd /srv/controles && ./controle-http.sh > /tmp/controle-http.log 2>&1 || mail -s "HTTP codes: mismatch detected" seo@example.com < /tmp/controle-http.log
```

Run it from a machine other than the monitored server: a check hosted on the site goes down with it. Without a server, the same script runs in GitHub Actions following the model in [schedule automated crawls](https://checklist-seo-geo.com/en/automation-quality-control/schedule-automated-crawls), bearing in mind that scheduled runs there are delayed during periods of high load: for uptime, an external probe remains more reliable.

### Uptime probes

Monitoring services test the site every one to five minutes from several regions, which a cron script does not do. Add at least three probes: the homepage, a dynamic page with an expected keyword, and robots.txt.

- **UptimeRobot**: an HTTP(s) monitor for the status code, and a Keyword monitor to check that a piece of text is present, which detects a blank page served with 200.
- **Uptime Kuma** (free, self-hosted): in the advanced settings of an HTTP(s) monitor, the Accepted Status Codes field lets you require a specific code, and setting Max. Redirects to 0 lets you check that an old URL does respond with a redirect rather than following it to its target.

Detailed setup and alerting rules (confirmation after two failures, two channels, escalation) are covered in [monitor uptime and alerts](https://checklist-seo-geo.com/en/security-infrastructure/monitor-uptime-alerts).

### Test with crawler identities

A firewall, CDN or security plugin can respond differently depending on the user agent. Add to the check a few requests that identify themselves as the main crawlers:

```bash
for ua in "Googlebot/2.1 (+http://www.google.com/bot.html)" "bingbot/2.0" "OAI-SearchBot/1.0" "PerplexityBot/1.0"; do
  echo "$(curl -s -o /dev/null -w '%{http_code}' -A "Mozilla/5.0 (compatible; $ua)" https://example.com/) $ua"
done
```

A 403 or 429 for a crawler you want to let in signals a blocking rule to fix. This test does not reproduce everything: a firewall that checks the real crawler's IP address will let the real Googlebot through and block your imitation, or the reverse. The full method is in [test HTTP responses for each crawler](https://checklist-seo-geo.com/en/ai-crawler-access-data-policy/test-http-responses-each-crawler).

### Apache

Versions: Apache 2.4, `combined` log format.

Count the 5xx errors of the last hour in the access log and alert above a threshold. Script `/srv/controles/taux-5xx.sh`:

```bash
#!/usr/bin/env bash
JOURNAL=/var/log/apache2/access.log
SEUIL=20
DEPUIS=$(LC_ALL=C date -d '1 hour ago' '+%d/%b/%Y:%H')
NB=$(grep -F "[$DEPUIS" "$JOURNAL" | awk '$9 ~ /^5/' | wc -l)
if [ "$NB" -gt "$SEUIL" ]; then
  echo "$NB 5xx errors in the hour $DEPUIS"
  exit 1
fi
```

Schedule it every hour at minute 5 (`5 * * * *`) with the same redirection to `mail` as the main script. On Red Hat distributions, the log is in `/var/log/httpd/access_log`. The threshold depends on traffic: start from the average of a normal week, multiplied by three.

### Nginx

Versions: Nginx 1.18 and later, default `combined` log format.

The script in the Apache section works as is with `JOURNAL=/var/log/nginx/access.log`: in the default format, the HTTP status code is also the ninth field. If you have defined a custom format, adapt `$9`. Also check `/var/log/nginx/error.log`: the `upstream timed out` and `connect() failed` messages often precede 502 and 504 errors.

### Cloudflare

Versions: Cloudflare dashboard, November 2026; Health Checks from the Pro plan.

- **Codes served**: the domain's Analytics tab breaks traffic down by response code; codes 520 to 527 indicate a problem between Cloudflare and your origin server.
- **Health Checks**: an HTTPS probe of the origin from several regions, with expected code and notification.
- **Crawler blocks**: in [Security Analytics](https://dash.cloudflare.com/?to=/:account/:zone/security/analytics), filter on verified bots to see whether a rule blocks or challenges them.
- **Notifications**: the account's Notifications page lists the alerts available on your plan; turn on the ones about origin health.

### AWS

Versions: AWS console, November 2026.

- **Application Load Balancer**: a CloudWatch alarm on the `HTTPCode_Target_5XX_Count` metric, “Sum” statistic over five minutes, linked to an SNS topic (email, SMS, messaging).
- **CloudFront**: an alarm on the distribution's `5xxErrorRate` metric; it reports the errors that visitors and crawlers actually receive.
- **CloudWatch Synthetics**: a canary that loads the URLs of the reference list at regular intervals, with an alarm on its success rate.

### Google Cloud

Versions: Cloud Monitoring, November 2026.

In `Uptime checks > Create uptime check`, enter the host, the path and the accepted response codes, then create the alerting policy offered at the last step.

### Azure

Versions: Application Insights, November 2026.

In `Availability > Add Standard test`, enter the URL, the expected code and at least three test locations, then attach an action group to the alert rule.

### Plesk

Versions: Plesk Obsidian 18.0.

Plesk does not offer external checking of your URLs' status codes: use the script or an external probe. For diagnosis, open `Websites & Domains > your domain > Logs`, filter on 5xx codes and read the PHP errors at the same timestamp.

### cPanel

Versions: cPanel, Jupiter theme, November 2026.

The `Metrics > Errors` and `Metrics > Raw Access` sections give the latest errors and the downloadable access log. cPanel's scheduled tasks (`Advanced > Cron Jobs`) can run the check script, but it would then test the site from its own server: prefer an external probe for uptime.

### Shared hosting

You have neither server access nor real-time logs: combine a free external probe (homepage, dynamic page, robots.txt) with the check script run from GitHub Actions or another computer. Keep the incident history to back up your requests to the host's support team.

### WordPress

Versions: WordPress 6.4 and later.

- **Redirects**: if they are managed by a plugin (Redirection, Rank Math, Yoast SEO Premium), add the most important ones to the reference list. Deactivating the plugin removes them all at once.
- **404 log**: the Redirection plugin can log 404s; check it every week to spot old URLs that are still being requested.
- **Dynamic page**: monitor an internal search (`/?s=test`), which queries the database without going through the page cache.

### Laravel

Versions: Laravel 11 to 13.

On a server you manage, the scheduler can run the check script and email you its output when there is a mismatch. Put the script and the list in a `scripts/` folder of the project, then in `routes/console.php`:

```php
use Illuminate\Support\Facades\Schedule;

Schedule::exec(base_path('scripts/controle-http.sh').' '.base_path('scripts/controles-http.csv'))
    ->everyFifteenMinutes()
    ->environments(['production'])
    ->emailOutputOnFailure('seo@example.com');
```

Add a feature test for each important redirect declared in the application, for example `$this->get('/ancienne-categorie')->assertRedirect('/categorie/chaussures')->assertStatus(301);`. The scheduled check runs on the application server: it does not replace an external probe for uptime.

### Next.js

Versions: Next.js 15 and 16.

Redirects declared in `next.config.js` with `permanent: true` respond with a 308 code, not 301. Google treats both as permanent redirects; simply enter `301|308` in the reference list to avoid a false alert. Run the check script after each deployment, against the production domain: that is when redirect rules get lost. On Vercel, the project's `Logs` tab can also filter requests by response code.

## Common mistakes

- **Monitoring only the homepage**: often cached, it responds even when the database is down.
- **Following redirects in the check**: the probe sees a final 200 and detects neither the redirect chain nor a redirect to the wrong page.
- **Hosting the probe on the monitored server**: it goes down with it and warns no one.
- **Forgetting robots.txt**: if it starts returning 5xx, Google suspends crawling, while the site seems to work for visitors.
- **Ignoring 403 and 429 responses**: they sometimes affect only crawlers, because of a firewall rule, and show up in no standard probe.
- **Keeping a frozen list**: after a redesign or a new category, update the reference list.
- **Alerting on every isolated failure**: a one-minute network glitch wakes the team up for nothing. Confirm on two consecutive failures.

## Frequently asked questions

### Which HTTP status codes should you monitor for SEO?

First monitor 5xx errors, which slow down Google's crawling and can push pages out of the index if they persist. Then check that important pages return 200, that old URLs redirect with a 301 to the right target, and that a made-up URL does return 404. Add the 403 and 429 codes received by crawlers, often caused by an overly strict firewall.

### How often should you check your site's HTTP status codes?

The uptime of the homepage and of a dynamic page is tested every one to five minutes with an external probe. The codes of a list of twenty to fifty reference URLs, redirects included, are checked every fifteen minutes to every hour, and after each deployment. Exhaustive checking of every URL on the site is the job of a scheduled crawl, weekly or daily depending on the size of the site.

### Does an outage of a few hours cost rankings?

An outage of a few hours rarely has a lasting effect on rankings. Google slows down its crawling when it meets 5xx errors and comes back when the site responds again. The risk grows when errors last several days: pages can then drop out of the index. During planned maintenance, serve a 503 code rather than an error page returning 200 or a 404.

### How do I know whether my firewall is blocking Googlebot?

Open the Search Console crawl stats and look at the breakdown by response: a rise in 403s or access errors signals a block. The firewall or CDN log shows which rule blocked the requests from verified crawlers. A test with curl and Googlebot's user agent gives an indication, but does not reproduce the IP address verification that some firewalls perform.

## Resources

- [Google Search Central: HTTP status codes, network and DNS errors](https://developers.google.com/search/docs/crawling-indexing/http-network-errors)
- [Google Search Central: how Google interprets robots.txt and error codes](https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt)
- [Search Console Help: Crawl Stats report](https://support.google.com/webmasters/answer/9679690)
- [MDN: HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status)
- [curl: the --write-out option](https://everything.curl.dev/usingcurl/verbose/writeout.html)
- [Laravel: HTTP client](https://laravel.com/docs/http-client)
- [Next.js: redirects in next.config.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/redirects)

Next steps: [monitor robots.txt and noindex](https://checklist-seo-geo.com/en/automation-quality-control/monitor-robotstxt-noindex), [create deindexing alerts](https://checklist-seo-geo.com/en/automation-quality-control/create-deindexing-alerts) and [fix redirect chains](https://checklist-seo-geo.com/en/http-redirects/fix-redirect-chains).
