1.在项目中的/protected/config/main.php中修改:
2.在与index.php文件同级目录下添加文件“.htaccess”,内容如下:
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
其他说明:
我现在用的是nginx服务器,也可不使用第2步,通过配置nginx来完成