1.修改/usr/local/testWeb/frontend/config/main.php文件为:
[
'components' => [
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'enableStrictParsing' => false,
'suffix' => '.html',
'rules' => [
// ...
],
],
],
]
2./ect/nginx/nginx.conf,修改配置:
location / {
# root /usr/local/nginx/html;
root /usr/local/testWeb/frontend/web;
index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^/(.*) /index.php last;
}
}
3.