原因:
(这里以 nginx 服务环境为例)
1、nginx 中配置的 root 参数路径不正确。
2、nginx 中的参数值后面忘记加分号。
3、nginx 中没有配置URL重写。
server {
listen 80;
# 域名后记得加分号
server_name www.your_domain.com;
# 确保此路径下有 index.php 文件
root "D:\www\your_domain\public";
index index.html index.htm index.php;
location / {
// …..省略部分代码
# URL重写
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
}