在配置Linode Debian VPS中使用到的WordPress网页地址重写规则。

1.lighttpd的wordpress mu的子域名方式地址重写

$HTTP["host"] =~ "it580\.com" {
    simple-vhost.default-host = "it580.com"
    server.error-handler-404 = "/index.php"
    url.rewrite-once = (
         "^/(.*/)?files/$" => "/index.php",
         "^/(.*/)?files/(.*)" => "/wp-content/blogs.php?file=$2",
         "^(/wp-admin/.*)" => "$1",
         "^/([_0-9a-zA-Z-]+/)?(wp-.*)" => "/$2",
         "^/([_0-9a-zA-Z-]+/)?(.*\.php)$" => "/$2",
         )

     }

2.lighttpd的wordpress的地址重写

$HTTP["host"] == "cindywm.com" {
       server.name = "cindywm.com"
       url.rewrite-final = (
            "^/(wp-admin|wp-includes|wp-content|gallery2)/(.*)" => "$0", 
            "^/(.*.php)" => "$0",
            "^/(.*)$" => "/index.php/$1"
            )
         }

Tagged with:
 

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^

Tagged with:
 
Blog WebMastered by All in One Webmaster.