CodeIgniter Forums
404 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: 404 (/showthread.php?tid=75614)



404 - Knutsford - 02-26-2020

I am trying to upgrade to codeignitor 3.1.6 and I am now getting a 404

This the layout of the site


-application
--controllers
---Index.html
--modules
------web
----------config
---------------routes.php
----------controllers
---------------Pages.php
----------models
----------views






The main routes.php has

$route['default_controller'] = "web/pages";
$route['404_override'] = 'web/pages';


The one under web has

$route['web'] = "pages";


In Codeigniter.php I have


Code:
if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php'))
{
    $e404 = TRUE;
    echo "aaa";
    if (empty($class))
    {
        $e404 = TRUE;
        echo "qqq";
    }
    if (! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php'))
    {
       $e404 = TRUE;
       echo APPPATH.'controllers/'.$RTR->directory.$class.'.php';
       echo "rrr";
    }
}

 When I go to the site I get something like

aaaqqq/home/blaa/blaa/application/controllers/../modules/web/controllers/.phprrr


It isn't finding a class and it has /controllers before modules



The problem is obviously that is isn't finding a class but I have no idea why or where to look. Thanks


I have just changed

$route['default_controller'] = "web/pages";

$route['404_override'] = 'web/pages';

to

$route['default_controller'] = "web/Pages";

$route['404_override'] = 'web/Pages';



Which sends it to the right place but I have got the original problem back that it is ignoring _remap


public function _remap()

    { 

}

is the _remap() call


RE: 404 - InsiteFX - 02-26-2020

The default controller cannot be in a sub folder.


RE: 404 - Knutsford - 02-27-2020

But that is how the current 2.2.1 version works. I didn't write it.


RE: 404 - InsiteFX - 02-27-2020

Your web site seems to be using HMVC Modules which means if you are upgrading to CI 3.1.x
you also need to upgrade the HMVC Module code.

If you read your other topic I told you that there are all kinds of fixes for HMVC that need to be made.


RE: 404 - Knutsford - 02-27-2020

(02-27-2020, 04:37 AM)InsiteFX Wrote: Your web site seems to be using HMVC Modules which means if you are upgrading to CI 3.1.x
you also need to upgrade the HMVC Module code.

If you read your other topic I told you that there are all kinds of fixes for HMVC that need to be made.
I have got it working at last. I moved the contents of _remap to function index then there was a missing function call in Front_Controller plus umpteen msql to msqli changes as well which I already knew about. How the original one works with theat function missing I have no idea but it does.


RE: 404 - InsiteFX - 02-27-2020

Glad to hear that you got it working.


RE: 404 - Knutsford - 02-28-2020

(02-27-2020, 02:59 PM)InsiteFX Wrote: Glad to hear that you got it working.
So am I. The front end is anyway. Not sorted the admin out yet. I have done upgrades before but not had problems like this.