mediawiki的rewrite规则

配置nginx的rewrite规则,实现页面URL重构。

打开nginx的配置文件nginx.conf,在 location / { … } 节点中添加如下配置项即可:

if (!-f $request_filename){
rewrite ^/wiki/([^?])(?:?(.))? /mediawiki/index.php?title=$1&$2 last;
rewrite (.*) /index.php;
}

Leave a Reply

Your email address will not be published.