错误如下:404 Not Found
调用index.php跳转到静态页面时报404错误
在nginx的站点配置conf文件的server节点下的location / 中添加重写规则
# 如果请求的文件不存在
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last; #跳转到根目录下的index.php
}
重启nginx服务器使用配置规则生效
再次找到php网站 ,此时成功访问。
错误如下:404 Not Found
调用index.php跳转到静态页面时报404错误
在nginx的站点配置conf文件的server节点下的location / 中添加重写规则
# 如果请求的文件不存在
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last; #跳转到根目录下的index.php
}
重启nginx服务器使用配置规则生效
再次找到php网站 ,此时成功访问。