Merge pull request #10 from mathroc/feature/404-status-code
Answer with a 404 status code when the page is not found
This commit is contained in:
commit
f43efaa2bd
@ -21,7 +21,10 @@ class Pico {
|
|||||||
else $file .= '.txt';
|
else $file .= '.txt';
|
||||||
|
|
||||||
if(file_exists($file)) $content = file_get_contents($file);
|
if(file_exists($file)) $content = file_get_contents($file);
|
||||||
else $content = file_get_contents(CONTENT_DIR .'404.txt');
|
else {
|
||||||
|
$content = file_get_contents(CONTENT_DIR .'404.txt');
|
||||||
|
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
|
||||||
|
}
|
||||||
|
|
||||||
$meta = $this->read_file_meta($content);
|
$meta = $this->read_file_meta($content);
|
||||||
$content = preg_replace('#/\*.+?\*/#s', '', $content); // Remove comments and meta
|
$content = preg_replace('#/\*.+?\*/#s', '', $content); // Remove comments and meta
|
||||||
|
Loading…
x
Reference in New Issue
Block a user