这个问题一般是linux 跟window 开发环境的差异导致的
首先检测你的Apache开启了rewrite_module模块,
然后开启Apache的rewrite_module模块:
在项目根目录创建.htaccess文件(伪静态),文件内容如下
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
nginx为
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}