How to create custom 404 redirect in codeigniter?

How to create custom 404 redirect in codeigniter?
there are lots of post on website which told you about custom 404 redirect in codeigniter but most of them are worth less.
Give a minute on this post and you will see this blog give exact what you want.

Step first: Create a file in your controller errors.php
and paste this code in this file
<?php

class Errors extends Controller {

function Errors()
{
parent::Controller();
}
function error_404()
{
$this->load->view('error_404');
}
}
?>




Step Two: Create a file in your View folder name as error_404.php
and write you error msg in this page


Step Three: Now opne this file  yoursite/system/core/Common.php
and search this function show_404()
Please note: in many version common.php file in another folder so you can search for this file on this root also yoursite/core/codeigniter/Common.php
And replace this code with this function


function show_404($page = '')
{
header('Location:http://www.sitename.com/errors/404_override');
exit;
}



Step 4: Now refresh your page and entered wrong url it will show your custom 404 page

Comments