Permalink
Browse files

Adding support for redirection on 404. Fixes #6. Thanks to reaperhulk…

… for contributing a patch.
  • Loading branch information...
1 parent 3528a79 commit aafdf05580d828a94ee1086062343ed13917ff1f @alanhogan committed Sep 16, 2010
Showing with 8 additions and 3 deletions.
  1. +8 −3 index.php
View
@@ -61,9 +61,14 @@
{
// 404!
// no redirect
- header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
- header('Status:404');
- die('404: Nothing found for '.htmlentities($token));
+ if (defined('ERROR_404_URL') && ERROR_404_URL !== NULL){
+ header("Location: ".ERROR_404_URL);
+ die;
+ } else {
+ header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
+ header('Status:404');
+ die;
+ }
}
}

0 comments on commit aafdf05

Please sign in to comment.