美文网首页
YII 接口后缀配置,伪造URL后缀

YII 接口后缀配置,伪造URL后缀

作者: lookphp | 来源:发表于2020-06-24 20:04 被阅读0次

在配置文件main.php中:

'urlManager'=>array(
            'urlSuffix' => '.html', //action加上.html后缀,全局后缀为.html
            'showScriptName'=>false,
            'urlFormat'=>'path',
            'rules'=>array(
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
                '<controller:\w+>/<action:\w+>/<pid:\d>'=>'<controller>/<action>/<pid>',
                'versionReq'=>array('/versionReq', 'urlSuffix'=>'.jsp', 'caseSensitive'=>false),//单一接口的后缀名
            ),
        ),

1.1的文档说明
2.0的文档说明

重命名某个请求url,将'profile/profileBase/index' 重命名为 'profile/read/index'

 'urlManager' => array(
        'urlFormat' => 'path',
        'showScriptName' => false,
        'rules' => array(
          'profile/read/index '=>'profile/profileBase/index'
        ),
    ),

相关文章

网友评论

      本文标题:YII 接口后缀配置,伪造URL后缀

      本文链接:https://www.haomeiwen.com/subject/vvddfktx.html