我在nginx服务器上使用 yii2.0.3 的基本模板,并在 web/theme/demo 下有一个演示主题。
我已经为主题配置了 web.php,如下所示。
'components' => [
'view' => [
'theme' => [
'pathMap' => ['@app/views' => 'theme/demo'],
'baseUrl' => 'theme/demo'
]
],
一切正常。我想从主页的 url 以及其他页面中删除web/index.php 。由于 nginx 不支持.htaccess,我在web.php文件中简单地设置了以下规则
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'enableStrictParsing' => false,
'rules' => [],
],
我没有在“规则”中添加任何内容..所以干净的 url 可能无法正常工作。请帮助我从模板的每个页面中删除/web/ 。