Nginx的WordPress中文rewrite规则

 location / {
            root   /www;
            index  index.php index.html index.htm;
            if (-f $request_filename/index.html){
                    rewrite (.*) $1/index.html break;
            }
            if (-f $request_filename/index.php){
                    rewrite (.*) $1/index.php;
            }
            if (!-f $request_filename){
                    rewrite (.*) /index.php;
            }
        }

 

完美支持中文,亲测成功。添加在Location{}中间。

CC BY-NC-SA 4.0 Nginx的WordPress中文rewrite规则 by 桔子小窝 is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

发表回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据