有无后缀都可访问,怎么默认url是.html后缀,直接上代码
'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, // 'enableStrictParsing' => false, // 'suffix' => ".html", 'rules' => [ //'<controller:\w+>/<action:\w+>/<lang:\w+>'=>'<controller>/<action>', '/<lang:\w+>/contact'=>'web/contact', '/<lang:\w+>/index'=>'web/index', '/contact'=>'web/contact', '/contact.html'=>'web/contact', '/index'=>'web/index', '/index.html'=>'web/index', '/<lang:\w+>'=>'web/index', ], ],