Yii advanced url rewrite

前端 未结 3 1105
Happy的楠姐
Happy的楠姐 2021-02-02 03:01

pay attention to that ANYTHING_ELSE So, I have my controllers and actions that I want to behave as normal in response to examples like this:

// for UserContoller         


        
3条回答
  •  粉色の甜心
    2021-02-02 03:14

    Read my article on how to handle that specific scenario (plus other things) with Wordpress: http://www.yiiframework.com/wiki/322/integrating-wordpress-and-yii-still-another-approach-using-yii-as-the-router-controller/

    In essence, in order to handle a default like that (and hand it off to a different system), tr easiest way to do it is to override Yii's exception handling system, catch 404 errors and hand those to your blog controller.

    If you send people to your blog controller by setting your controller action as an error handler, Yii sends a 404 error header (even if your properly handle the error). Yes, I've dug into this a lot. No, I don't believe there is a simpler answer :-). I'd love to know if you do find something simpler ...

提交回复
热议问题