关于nginx wordpress目录式永久链接斜杠的问题

我的wordpress一直以为是启用目录式的永久链接,如http://devops.webres.wang/2012/01/real-time-rsync-file-with-sersync/。今天当我用http://devops.webres.wang/2012/01/real-time-rsync-file-with-sersync这样的链接,即尾部少一斜杠时,文章照样能顺利地访问,这时候查看这个地址返回的状态码,是200,而不是我所想的301。虽说没什么影响,但为了链接规范与唯一性,决定做301处理。
在nginx的配置文件中加入如下跳转规则:

  1. if (!-f $request_filename){ rewrite ^/([^.]+[^/])$ http://$host/$1/ permanent; }