Page not found not giving 404 header

Permalink
I have discovered a strange problem in my c5 installation.

When I try to access a page by name (e.ghttp://www.example.com/index.php/nonexisting... ) The page_not_found single_page is shown, but the page_not_found controller is not run and so the 404 header is not set. When using a non-existing cid (http://www.example.com/index.php?cID=9999) it works correctly.

I downloaded the latest version from github, installed it with samle content and tried it again. But then it is working...
Copied the concrete folder to my own installation but the problem still exists.

Whats wrong with my installation? I just can figure it out. Hopfully someone else can help me.

 
ScottC replied on at Permalink Reply
ScottC
are you getting a 301 instead?
rklomp replied on at Permalink Reply
No i just get a status 200 OK
rklomp replied on at Permalink Reply
I discovered that it is a problem in my database. Installed concrete 5 in another directory with a new database an it works. Changed the database of my non-working version to the new one and the problem is gone..

Strange...
rklomp replied on at Permalink Reply
public function getRequestedPage() {
      $path = $this->getRequestCollectionPath();
      $origPath = $path;
      $r = Cache::get('request_path_page', $path);
      if ($r == false) {
         $r = array();
         $db = Loader::db();
         $cID = false;
         while ((!$cID) && $path) {
            $cID = $db->GetOne('select cID from PagePaths where cPath = ?', $path);
            if ($cID) {
               $cPath = $path;
               break;
            }
            $path = substr($path, 0, strrpos($path, '/'));


if ($r == false) {
   $r = array();


And later
if (is_array($r)) {


Of course it is an array.. It was just created as array.


EDIT:
When i change it to
if (is_array($r) && !empty($r)) {
Everything works as expected, but i don't know whether this is the real solution and what is the real cause of the problem..
rklomp replied on at Permalink Reply
Discovered that in both installations (the "problem free" and "problematic") the page not found controller is not run when calling a subpage of an existing page, likehttp://www.example.com/index.php/existing/nonexisting...
andrew replied on at Permalink Reply
andrew
What version of concrete5 are you running? We fixed a bug relating to this in 5.5.0.
rklomp replied on at Permalink Reply
# Concrete5 Version
5.5.1.1
rklomp replied on at Permalink Reply
Any solution on this?