Q2A apache转为nginx后规则设置

2020-10-16 14:28:21
黄豆 UsualTool.com
编程思维/PHP 1856
loading

Q2A apache转为nginx后,若要伪静态继续生效,则在配置文件中添加:

location / {
        index index.php index.html index.htm;
        if (!-f $request_filename) {
            rewrite ^/(.+)?$ /index.php?qa-rewrite=$1 last;
        }
    }
    location /index {
        rewrite ^/index/([^/]+)/([^/]+)/([^/]+) /index.php?qa=$1&qa_1=$2;
    }

便可以解决nginx下的伪静态问题。

+分享给朋友+
郑重提醒:部分素材来源于互联网,如果侵犯了您的权利,请及时联络我们更正,谢谢合作,电邮:usualtool@qq.com