VPS侦探论坛

标题: nginx如何pathinfo模式和普通模式同时存在 [打印本页]

作者: zhlin163    时间: 2016-7-2 18:56
标题: nginx如何pathinfo模式和普通模式同时存在
求助,nginx配置中,如何让pathinfo模式和普通模式同时存在,pathinfo模式也可以访问,普通模式也可以访问
作者: licess    时间: 2016-7-2 19:48
你说的伪静态吗?
作者: zhlin163    时间: 2016-7-2 19:56
标题: 回复 2# 的帖子
是啊,当前所有的路径都走了pathinfo,但是网站还有插件是普通url,所以现在普通的url打不开网站
include none.conf;
        #error_page   404   /404.html;
        rewrite ^/([0-9]+)$ /index.php/Show/index/roomnum/$1;
        rewrite ^/([0-9]+)/([0-9]+)$ /index.php/Show/index/roomnum/$1/qrid/$2;

        location ~ [^/].php(/|$)
        {
            # comment try_files $uri =404; to enable pathinfo
           #try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
            include pathinfo.conf;
        }

        location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*.(js|css)?$
        {
            expires      12h;
        }
作者: licess    时间: 2016-7-3 09:08
标题: 回复 3# 的帖子
/index.php/Show/index/roomnum/$1 的形式就是pathinfo的

你再设置一个伪静态肯定就没法访问pathinfo的形式了

thinkphp之类的框架也都是伪静态或pathinfo选一
作者: zhlin163    时间: 2016-7-3 17:09
标题: 回复 4# 的帖子
谢谢军哥百忙中的解答,已经可以了
作者: W.I.N    时间: 2016-12-14 21:55
标题: 回复 5# 的帖子
怎么解决的能告知下吗~




欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/) Powered by Discuz! X3.4