标签:yii2.0 路由
‘urlManager‘ => [
‘enablePrettyUrl‘ => true, //路由的路径化
‘showScriptName‘ => false, //隐藏index.php
‘enableStrictParsing‘ => true, //请求应匹配至少一个规则 不能访问没有在规则中列出的路由
‘rules‘ => [
‘/mobile/<source:(user|doctor)>/<action:\w+>‘ => ‘appv3/<action>‘,
"<controller:\w+>/<action:\w+>/<id:\d+>" => "<controller>/<action>",
‘<controller:\w+>/<action:\w+>‘ => ‘<controller>/<action>‘,
],
// ‘suffix‘ => ‘.html‘, //后缀名
],
如果填写suffix,访问的域名不能带.html(我的环境是这样的)
标签:yii2.0 路由
原文地址:http://jinliang.blog.51cto.com/8981814/1633581