[eluser]riwakawd[/eluser]
When i set my config item to true config_item('system_maintenance') it redirects to URL but Firefox display error saying redirection error. I have attached error image
Redirects to URL OK but just unable to load page
Error:
Code:
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
MY_Controller.php
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Controller extends MX_Controller {
public function __construct() {
parent::__construct();
if(!config_item('system_installed')) redirect('install');
}
}
class Catalog_Controller extends MY_Controller {
public function __construct() {
parent::__construct();
if(config_item('system_maintenance')) redirect('maintenance');
}
}
class Admin_Controller extends MY_Controller {
public function __construct() {
parent::__construct();
if(!config_item('system_installed')) redirect('install');
}
}
Config.php
Code:
/*
|--------------------------------------------------------------------------
| Checks If System Is Installed
|--------------------------------------------------------------------------
|
| Typically this will be set to FALSE on the main application directory if
| you have not set up via the install wizard. You must use install wizard to set up.
| You will not be able to view website if main application system_installed is set to FALSE MY_Controller System Check.
|
*/
$config['system_installed'] = TRUE;
/*
|--------------------------------------------------------------------------
| Checks If System Is Maintenance Mode
|--------------------------------------------------------------------------
|
| This system check makes sure user gets redirected to maintenane
| page. If set to true and allow access if set false.
|
|
*/
$config['system_maintenance'] = TRUE;
modules/catalog/common/maintenance.php
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Maintenance extends Catalog_Controller {
public function __construct(){
parent::__construct();
}
public function index() {
$this->load->model('admin/users_model');
if($this->users_model->isLogged()) {
$this->info();
}
}
public function info() {
$this->lang->load('catalog/maintenance', 'english');
$data['title'] = $this->lang->line('heading_title');
$data['heading_title'] = $this->lang->line('heading_title');
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->lang->line('text_maintenance'),
'href' => site_url('catalog/common/maintenance')
);
$this->load->view('theme/default/template/common/maintenance', $data);
}
}