0
<?php
header("HTTP/1.0 404 Not Found");
header("HTTP/1.1 404 Not Found");
header("Status: 404 Not Found");
// redirect to 404 page and exit
die(header("Location: 404.html"));

If I run it on local server everything is ok. But on working server it outputs blank page. I tried to remove first three headers, and it works. Anybody can explain me this behavior? Thank you.

vito78
  • 35
  • 5
  • try changing `die(header("Location: 404.html"));` with `header("Location: 404.html");exit;` – Charaf JRA Oct 02 '13 at 09:22
  • Saying "I can't find what you are looking for! What you are looking for is over at this other URL!" doesn't make any sense. – Quentin Oct 02 '13 at 09:22
  • http://stackoverflow.com/questions/437256/sending-a-404-error-in-php take a look at the answer of Alan Storm – steven Oct 02 '13 at 09:25

0 Answers0