php - Kohana 3 - redirect to 404 page -
after searching internet haven't found answer question. example, in base complectation if go http://yoursite/welcome/
you'll see hello world
if type http://yoursite/welcom/ you'll see fatal error: uncaught http_exception_404 [ 404 ]: requested url welcom/index not found on server. ~ syspath/classes/kohana/request/client/internal.php [ 94 ] thrown in
from here, how can redirect user 404 page if type wrong address?
kohana 3.1.3.1
here how it:
declare our own exception handler somewhere in bootstrap.php or module's init.php. application exceptions sent
kw_exception_handler::handle()
.exception handler analyses exception type (using
getcode()
method) , creates new hmvc request special error controller, example ('error/404').
also can add check ajax calls , return json structure error text.
ps. this userguide tutorial may helpful.
Comments
Post a Comment