Skip to content

2xx Success

200 OK

The request succeeded and the response body has the result (the page, the JSON, the file).

When you see it

  • Every normal page view and successful API call.
  • An error page sent with 200 by mistake (a "soft 404"), which search engines then index as a real page.

What to do

  1. 1

    Nothing to fix for real content.

  2. 2

    Make sure "not found" and error pages send 404 / 500, not 200, so they don't get indexed.

In Laravel

Returning a view or array from a controller sends 200. Use abort(404) or response()->json($data, 404) for errors so the status is right.

Check the status of a URL

The first line of the response shows the status code; -L follows redirects and shows each step.

curl -I https://example.com/page
curl -IL https://example.com/old-page

Frequently asked questions

What does HTTP 200 mean?

The request succeeded and the response body has the result (the page, the JSON, the file).

How does Laravel handle 200?

Returning a view or array from a controller sends 200. Use abort(404) or response()->json($data, 404) for errors so the status is right.

Get new articles in your inbox

Practical tutorials and deep dives, about once a week. No spam, unsubscribe anytime.

Privacy policy

Add DEV Talk to your Home Screen

  1. 1 Tap the Share button in Safari's toolbar.
  2. 2 Scroll down and tap Add to Home Screen.
  3. 3 Tap Add. Open it from the Home Screen to read like an app and to turn on notifications with the bell.

We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.