wordpress在nginx下的rewrite设置


因为服务器迁移的问题,新的web server是nginx。 可惜nginx不支持.htaccess。因此只能自己写rewrite规则。 我的站点url,wordpress里规则使用的是 http://blog.it580.com/%post_id%/.在nginx的配置文件中,配置如下:

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

修改完配置后,别忘记将nginx的服务reload 一下。^O^

comments powered by Disqus