1.把 public 文件夹下的 .htaccess 文件 放在和 index.php 入口文件相同的路径层级下.
2.修改.htaccess文件内容:
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>