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
  • 42,716
  • 77
  • 201
  • 296

1 Answers1

2

I have generally set error codes like this:

header('HTTP/1.0 404 Not Found');
Giacomo1968
  • 25,759
  • 11
  • 71
  • 103