1

When setting a custom status code response with PHP using header() is:

header("Status: 404 Not Found");

Correct, or:

header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");

Which is the http standard? Or, should you set both?

Justin
  • 38,686
  • 72
  • 185
  • 276

1 Answers1

2

I have generally set error codes like this:

header('HTTP/1.0 404 Not Found');
Giacomo1968
  • 24,837
  • 11
  • 67
  • 96