CodeIgniter Forums

Full Version: 404 page after upgrade
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I was using CI3 for a while, and recently I wanted to catch up with the latest update.
I first upgraded to from 3.0.0 TO 3.0.1 and all went well.

But from 3.0.1 to 3.0.2 throws a 404 page when accessing some controllers.
I replaced system folder and constants.php.

Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

Class Biz extends CI_controller {

    public function __construct() {
        parent::__construct();
    }
    public function privacy() {
        
         if (!$this->agent->is_mobile()) {
                    
                
        $this->load->view('footer/privacy');
                
                }  else {
                  $this->load->view('mobile/footer/privacy');
                }
    }
}


The file controller is Biz.php

On localhost I access the page with this link: http://localhost/ci/biz/privacy

Code:
$config['base_url'] = 'http://localhost/ci/';
$config['index_page'] = '';
$config['uri_protocol']    = 'REQUEST_URI';

routes
Code:
$route['biz/privacy']='biz/privacy';

And like I said, everything worked fine on 3.0.1 but same error 404 page with any version above that.

Any help and suggestions will be much appreciated

Thank you
When upgrading 3.0 to 3.1 you can just upgrade immediately to 3.1, then go through all the change logs to make sure all the instructions are followed. There is a lot of repeated info in there, so it really does not take very long at all.

One thing to check is that (I hope you made a backup) in your original index.php there were no additional configurations. Also did you upgrade the index.php file? I also presume you have not altered the system core files at all. From memory I think there were some changes to the config file too, so it might be worth comparing the latest version of the config file to your current version.

Not a lot of help I know - sorry.

Best wishes,

Paul
At first, I upgraded straight to 3.1, and then I encountered this issue. I really can't see what was wrong, then I decided to go one version at time. 3.0.1 worked fine, but the rest don't.
I didn't do any changes to the core.

3.0.1 to 3.0.2 there is only system files and constants.php file. And still same issue
Try changing the Prtocol to one of the other.

PHP Code:
$config['uri_protocol'] = 'PATH_INFO'
(08-21-2016, 04:01 PM)InsiteFX Wrote: [ -> ]Try changing the Prtocol to one of the other.

PHP Code:
$config['uri_protocol'] = 'PATH_INFO'

I think the problem is around routes file. Here is a strange thing.
The routes.php starts with:

Code:
$route['default_controller'] = "local/city";
$route['scaffolding_trigger'] = "";
$route['biz/[0-9a-zA-Z\-_]+']='biz/show';

more routes down here....

So some routes don't work unless they right under the Scaffolding_Trigger or all the way up

Code:
$route['default_controller'] = "local/city";
$route['scaffolding_trigger'] = "";
$route['biz/privacy']='biz/privacy';

$route['biz/[0-9a-zA-Z\-_]+']='biz/show';

Any reason this happening?
I am not sure if this is the solution, but it fixed my problem.

In the manual is states: "The reserved routes must come before any wildcard or regular expression routes."
I put all routes with wildcards and regular expression last and worked fine again.

Appreciated your help