wordpress在nginx下的rewrite设置

On 2007-07-06, in 手记, by David

因为服务器迁移的问题,新的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^

Related posts:

  1. Lighttpd WordPress Rewrite(Linode Debian VPS)
  2. 加入Google Analytics
  3. 优化网站的载入速度
  4. 申请一年免费的ZoneAlarm Pro
  5. links for 2008-10-27
Tagged with:
 

Leave a Reply