1:虚拟机配置文件修改:
location / { index index.php index.html; if (!-e $request_filename) { rewrite ^/index.php(.*)$ /index.php?s=$1 last; #必须在前面 rewrite ^(.*)$ /index.php?s=$1 last; break; }}
复制时 空格替换成tab ,否则可能报错哦
2:项目入口文件:.htaccess 保值默认即可
<IfModule mod_rewrite.c>Options +FollowSymlinks -MultiviewsRewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]</IfModule>