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.
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.
are you getting a 301 instead?
No i just get a status 200 OK
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...
Strange...
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, '/'));
Viewing 15 lines of 41 lines. View entire code block.
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 Everything works as expected, but i don't know whether this is the real solution and what is the real cause of the problem..
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...
What version of concrete5 are you running? We fixed a bug relating to this in 5.5.0.
# Concrete5 Version
5.5.1.1
5.5.1.1
Any solution on this?