How to suppress 404 for an unknown Controller ? |
[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
[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.
[eluser]Doosje[/eluser]
Look and delve into: http://ellislab.com/codeigniter/user-gui...asses.html Then, search the forum for custom 404 that should give you the power you're searhing for.
[eluser]Unknown[/eluser]
Hi, Thank you all. Core classes worked for me. I extended Router.php to solve the issue. Thanks & Regards Omal Raj |
Welcome Guest, Not a member yet? Register Sign In |