‘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(我的环境是这样的)
时间: 2024-10-08 07:09:14