Hello. I made custom 404 page
routes.php
Code:
$route['404_override'] = 'my404_controller';
application/controllers/my404_controller.php
PHP Code:
class my404_controller extends CI_Controller {
public function __construct() {
parent::__construct();
}
public function index(){
echo 'BLAAAAAAAAAA';
global $settings;
$this->output->set_status_header('404');
$data['content'] = 'hataaaa'; // View name
$this->load->view('templates/' . $settings->template.'/404.php',$data);//loading in my template
}
}
and
application/views/templates/default/404.php
Code:
<?php
if(!headers_sent()) header("content-Type: text/html; charset=UTF-8");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" />
<title></title>
</head>
<body>
<h1>Hello</h1>
ERRORRRRRRr
</body>
</html>
im calling show_404(); when article doesn't exists. But shows codeigniter's error page not my custom 404 view.
The page you requested was not found.
how can i fix it.
thanks inadvance.