0
我有下面这段代码处理404错误,但我想重定向所有的404错误,主页,这里就是我:PHP的错误日志404并重定向到主页
function show_404($page = '', $log_error = TRUE)
{
$heading = "404 Page Not Found";
$message = "The page you requested was not found.";
// By default we log this, but allow a dev to skip it
if ($log_error)
{
log_message('error', '404 Page Not Found --> '.$page);
}
echo $this->show_error($heading, $message, 'error_404', 404);
exit;
}
我怎么能重定向到主页而不是给404错误。
重定向到主页,然后显示实际的错误? – pmahomme
'header(“location:index.php”)',你想知道如何重定向? –
[Php header redirect]可能重复(http://stackoverflow.com/questions/4934357/php-header-redirect) –