I have already created custom 404 error page by changing the route in route.php
$route['404_override'] = 'error_404/index';
where error_404 is controller and this controller redirects to my custom 404 view page
<?php
ob_start();
class error_404 extends Front_Controller {
function __construct()
{
parent::__construct();
//make sure we're not always behind ssl
remove_ssl();
}
function index()
{
$this->load->view('404.php', '');
}
}
it few cases it does not load 404 error page and throws "Content Encoding Error" in those pages. I have searched in this portal tried the following options
1) In my Libraries creating a file name MY_Exceptions and extend it with CI_Exceptions
2) Redirecting in error_404.php to my custom page by adding header function
3) changing config $config['compress_output']=FALSE
4) adding ob_flush(); in system/core/Output.php
2 & 3 works but I do not want to change $config['compress_output'] nor want to make major changes in error_404.php which CI default redirects to...Any other way out?
How about you just render the page in your MY_Exception. I'm not sure if this will work for you but it always has for me,
In the controller:
application/core/MY_Exceptions
This way I can call
show_404()
in any another controller if I want to show that a particular resource is unavailable.