一般的出现这种情况时,nginx.conf 里的的 location 设置都是类似这样
location ~ .*\.php$
要支持 pathinfo,要改成
location ~ .*\.php(\/.*)*$
Typecho nginx 服务器无法实现伪静态化,在后台设置不成功
这主要是 nginx 的 rewrite 没有设置导致的,在 nginx.conf 里找到网站的 server 配置段,一般我们推荐如下的配置
server {
listen 80;
server_name blog.siddim.com;
root /data/htdocs/www/;
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location ~ .*\.php(\/.*)*$ {
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
}