YII2的urlManager基础应用
YII2的urlManager基础应用在配置文件的components中加入urlManager配置项 'urlManager' => [
'enablePrettyUrl' => true,//启用路由
'enableStrictParsing' => false,//启用严格解析
'showScriptName' => false,//是否显示index.php true 为显示 false 为不显示
//'suffix'=>'.html',//后缀
'rules' => [
//'<action:\w+>'=>'site/<action>',
]
],
.htaccess: Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
页:
[1]