Welcome Guest, Not a member yet? Register   Sign In
customize 404 page
#1

[eluser]peter[/eluser]
Hello, I would like to show customized error page for 404. I found this http://ellislab.com/forums/viewthread/205487/#957444 but it redirects to another controller (url changes) - BUT I need to leave the same "wrong" url in browser's url bar intact (don't redirect to another controller) and just show another content in application\errors\error_404.php. How to override original error_404.php content?

thanks
#2

[eluser]Spir[/eluser]
You have $route['404_override'] = ''; in you route.php config.
You can set a controller like not_found.php and keep URL so you won't have a redirect.
Code:
$route['404_override'] = 'not_found';

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class not_found extends CI_Controller
{
function index()
{
  $this->output->set_status_header('404');
  echo '404';
}
}
See more at the bottom of the page
http://ellislab.com/codeigniter/user-gui...uting.html




Theme © iAndrew 2016 - Forum software by © MyBB