↑ ↓ select, Enter open, Esc close

Check for soft 404s: does a missing page really return 404

Adjust the values, the command updates live
user@server
curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' https://example.com/diese-seite-gibt-es-nicht-$RANDOM

Appends a random path to the domain and shows the status code and, if present, the redirect target. Correct is 404 or 410. Google treats a 200 with an error page, or a blanket redirect to the homepage, as a soft 404, and such URLs needlessly stay in the crawl.

Note: The URL must end with a slash. $RANDOM works in bash and zsh.

Also searched as

  • detect soft 404
  • error page returns status 200
  • check 404 page status code
  • missing page redirects to homepage

Related one-liners

All in SEO checks

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.