国外免费开源Question2Answer在nginx下的伪静态rewrite规则,个人觉得还不错,分享


Question2Answer ,是国外免费开源的问答系统,基于 PHP + mysql 技术。个人觉得还不错,分享下Question2Answer在Nginx下的伪静态规则,哈哈,官方给的Question2Answer在nginx下的伪静态规则不行,少了点东西哦,呵呵。

Question2Answer在nginx下的伪静态规则如下:

if ($request_uri ~* "//") {
 rewrite ^/(.*) $scheme://$host/$1 permanent;
}

if (!-e $request_filename) {
 rewrite ^(.+)$ /index.php?qa-rewrite=$1 last;
 break;
}

相关内容