Welcome Guest, Not a member yet? Register   Sign In
Taking site live
#1

[eluser]DanTheMan[/eluser]
Hi all,

I have taken my site live to test any discrepancies between the live server and my sandbox server. This went well, everything seems to work correctly as expected apart from one thing.

I have tested all urls, all redirects etc and they all seem to work apart from one.

I am using HMVC approach. With this, I have a triad which has the following setup, as expected:
Code:
customer_portal
      Controllers
           customer_portal.php
           another.php
           somethingelse.php
      Models
           mdl_user.php
      Views
           various views....

This is the same as all my other triads. However, when trying to access this particular controller I get the following error:

Code:
404 Page Not Found

The page you requested was not found.

I have tried re-naming the controller, I just don't know what is up. I have tried changing from extending a custom controller to extending CI_Controller and nothing changes.

The strange thing about this is that nothing else seems to be effected, only this triad. I was wondering if anyone has had this before or can suggest what to troubleshoot.

Thanks in advanced,
Dan
#2

[eluser]micflan[/eluser]
Just a thought but check the captilization of file names and class names.

Filenames for controllers should be all lowercase. Controller class names should be first letter capitilized.
#3

[eluser]DanTheMan[/eluser]
Dear micflan,

Thanks for the reply.

I have checked and they are named correctly. folders and files are lowercase and inside i have the the following:

class Customer_portal extends Customer_Controller {
#4

[eluser]InsiteFX[/eluser]
You need to specify what version of CodeIgniter you are using!

1) Did you set the system and application folders in index.php ?

2) Did you set your application/config/config.php base_url ?

3) What version of HMVC are you using ?

4) Is your site running PHP 5+ ?

How I setup HMVC:

application/core/MY_Controller.php - if running CI 2.0+
Code:
class MY_Controller extends MX_Controller {

    public function __construct()
    {
        parent::__construct();
    }

}

// Admin_Controller - application/core/Admin_Controller.php
class Admin_Controller extends MY_Controller {

    public function __construct()
    {
        parent::__construct();
    }

}

// Public_Controller - application/core/Public_Controller.php
class Public_Controller extends MY_Controller {

    public function __construct()
    {
        parent::__construct();
    }

}

Now extended all your other Controllers from either Admin_Controller or Public_Controller

InsiteFX
#5

[eluser]DanTheMan[/eluser]
Dear InsiteFX,

Thanks for your response. The following is the information you required. I am using CI 2.0.

1) System and application settings in index.php are unmodified as I have kept them the same on the live server.

Code:
$system_path = "system";
$application_folder = "application";

2) I have set the base_url to the following, as using dynamic urls.

Code:
$config['base_url'] = 'http://'. $_SERVER['HTTP_HOST'];

3) I am using HMVC with MX_Controller from https://bitbucket.org/wiredesignz/codeig.../wiki/Home

4) I am using PHP 5+

5) Setup of HMVC.

I have a number of controllers in the core folder (e.g. Admin_Controller, Public_Controller, Customer_Controller, which all extend My_Controller. My Controller extends MX_Controller just like your example. Then controllers extend the specific controller (e.g. Customer_Controller, as you suggested.

The other modules are working ok, its just the module I specified (customer_portal) that refuses to work.

Thank you,
Dan
#6

[eluser]InsiteFX[/eluser]
Did you add this to your config.php ?

application/config/config.php
Code:
$config['modules_locations'] = array(
    APPPATH.'modules/' => '../modules/',
);

Otherwise you will need to show the code for your Controller

InsiteFX
#7

[eluser]Benito[/eluser]
I ran across a situation similar to yours. I was extending my own controllers and forgot to add this line on my live server to the config.php Just a thought..

Code:
function __autoload($class) {
      if (file_exists(APPPATH. 'core/'. $class . EXT )) {
          @include_once( APPPATH . 'core/'. $class . EXT );
          return true;
      }
      return false;
}




Theme © iAndrew 2016 - Forum software by © MyBB