E.g. I have a working url:
http://localhost/article/154
Where 154 is $id of the article in db and a controller article looks like e.g.:
function index ($id = '')
{
// some code here
}
Now, when I type something like:
http://localhost/article/154dsdead34
I get error because that id is not in my db. But, the php errors are shown on the page and the whole page is messedd up.
Instead I need a redirect to my controller called custom404 that can handle this (or if it is for some reason not possible at least a direct redirect('/'); to the homepage)
The same fix for variants like (to big $id number or not found in db):
http://localhost/article/3004534534534234600234
or (other parameters)
http://localhost/article/154/something/derer/asdasd
how to do such security check in CodeIgniter?