Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
404 management
#1
404 errors seems to not be catch.
When I look the code, I don't understand how it is supposed to work.
You can see my comments in the code below.
Code:
if (! file_exists($file)) {
    if (file_exists($file_404))    {
        $file = $file_404;
        exec_action('error-404');
    }
}

/*******************************
Why is there no "else" here ? it sould avoid notices on $data_index properties if the file doesn't exists
********************************/

$data_index = getXML($file);
[...]
$url = $data_index->url;
[...]

/*******************************
I think there are some problems between 403 and 404 and a test on $url is useless because in the case of 404, the url will be empty
********************************/
# if page is private, send to 404 error page
if ($private == 'Y') {
    header('Location: 403');
    exit;
}

# if page does not exist, throw 404 error
if ($url == '403') {
    header('HTTP/1.0 404 Not Found');
}
Reply


Messages In This Thread
404 management - by spilarix - 2010-05-07, 21:00:56
404 management - by Zegnåt - 2010-05-08, 02:07:07
404 management - by spilarix - 2010-05-08, 21:46:30
404 management - by Zegnåt - 2010-05-08, 23:27:18



Users browsing this thread: 1 Guest(s)