Welcome Guest, Not a member yet? Register   Sign In
How to suppress 404 for an unknown Controller ?
#1

[eluser]Unknown[/eluser]
Hi, I am new to CI.
I want to handle the controllers passed even if they doesn't exist.

eg: http://example.com/con/function

here con doesn't exist, but it should not display 404 page not found error.

I tried modifying system/application/config/routes.php as

$route['con'] = "test"; ( hoping to have controller name from test )

#-- CODE BEGIN
class Test extends Controller {

function Test()
{
parent::Controller();
}

function test()
{

}

function _remap($function) {
print $function; <-- out i got is index ?
}
}

#-- CODE END

Thanks & Regards
Omal Raj
#2

[eluser]Pascal Kriete[/eluser]
I'm not sure if I understand this correctly, what I would do is redirect the default 404 page to a existing controller. Then use the referrer to see where they went wrong, and process that accordingly.
#3

[eluser]Doosje[/eluser]
Look and delve into: http://ellislab.com/codeigniter/user-gui...asses.html
Then, search the forum for custom 404 Smile
that should give you the power you're searhing for.
#4

[eluser]Unknown[/eluser]
Hi, Thank you all.
Core classes worked for me.

I extended Router.php to solve the issue.

Thanks & Regards
Omal Raj




Theme © iAndrew 2016 - Forum software by © MyBB