当前位置: 动力学知识库 > 问答 > 编程问答 >

security - Zend Framework: How do i secure zend url pattern?

问题描述:

I am using url rewrite controller to make custom urls. No i dont know how to secure them or if the user types some thing else then how do i show a page not found error.

Here is how i am making custom urls in my application index:

$route = new Zend_Controller_Router_Route_Regex(

'([A-Z]*(([\/][A-Z0-9\-]*([\/][A-Z]*)?)?))',

array('controller'=>'Uriprocess','action'=>'index'),

array(1 => 'URI')

);

$router->addRoute('URIPROCESS',$route);

网友答案:

You should check Zend_Controller_Plugin_ErrorHandler

Since the ErrorHandler plugin captures not only application errors, but also errors in the controller chain arising from missing controller classes and/or action methods, it can be used as a 404 handler. To do so, you will need to have your error controller check the exception type.

分享给朋友:
您可能感兴趣的文章:
随机阅读: