Welcome Guest, Not a member yet? Register   Sign In
Problem in showing customized 404 error page

To show custom 404 error page I did the following

$route['404_override'] = 'errors';

where errors is my custom controller. Now above this is working if controller/method not found.But suppose if we passed some parameters after the method name them its not working and shoeing the default 404 page

For example: (domian name)/(controller)/(method)/(incorrect parameters) , it execute default 404 page rather then my custom 404 page

Is something I am missing ?

That means that the CI found a controller and a method... So it won't be passed to errors controller. I think you should check for the parameters if they are correct and if not do a redirect, or even to put some default values to them.

i have a controller name errors as well in it i have a function named: not_found

to override the default 404 i put this:

$route['404_override'] = 'errors/not_found';

and it works perfectly fine.

in your case however, you could check for the parameter, and if it is valid or not. then do a redirect like so:

redirect('errors/not_found', 'refresh);
"I reject your reality and substitute my own" - Adam Savage, M5 Inc.

Theme © iAndrew 2016 - Forum software by © MyBB