今天更新了VPS 上的操作系统,也顺带更新了Nginx PHP Mysql 等,Nginx上老的Wordress Rewrite 规则就都失效了,这导致了所有文章页面都404了,幸好在stackoverflow.com找到了答案。
正确规则如下,请添加在你的虚拟主机配置文件内
location / { # This is cool because no php is touched for static content. # include the "?$args" part so non-default permalinks doesn't break when using query string try_files $uri $uri/ /index.php?$is_args$args =404; } if (!-e $request_filename) { rewrite ^.*$ /index.php last; } |