代碼如下:
location / {
rewrite ^/caipu-([0-9]+)-([0-9]+)-([0-9]+l /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last;
rewrite ^/content-([0-9]+)-([0-9]+)-([0-9]+l /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last;
rewrite ^/list-([0-9]+)-([0-9]+l /index.php?m=content&c=index&a=lists&catid=$1&page=$2 last;
rewrite ^/tag-([^.]*)-([0-9]+)-([0-9]+l /index.php?m=content&c=tag&catid=$2&tag=$1&page=$3 last;
rewrite ^/comment-([0-9]+)-([0-9]+)-([0-9]+l /index.php?m=comment&c=index&a=init&commentid=content_$1-$2-$3 last;
rewrite ^/([^.]*l /index.php?m=member&c=index&a=$1 last;
}
然后就出現(xiàn)杯具了。打開網(wǎng)站首頁時提示“Action does not exist.”意思是行為不存在?我翻遍了百度,在phpcms官方論壇有人說這個錯誤是地址問題,再聯(lián)想到我是修改偽靜態(tài)出現(xiàn)的······我懂了,是首頁偽靜態(tài)問題!
在我對照了wordpress官方的寫法后,我TM終于寫成了。。。
代碼如下:
location / {
if (!-f $request_filename){
rewrite (.*) /index.php;
}
rewrite ^/caipu-([0-9]+)-([0-9]+)-([0-9]+l /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last;
rewrite ^/content-([0-9]+)-([0-9]+)-([0-9]+l /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last;
rewrite ^/list-([0-9]+)-([0-9]+l /index.php?m=content&c=index&a=lists&catid=$1&page=$2 last;
rewrite ^/tag-([^.]*)-([0-9]+)-([0-9]+l /index.php?m=content&c=tag&catid=$2&tag=$1&page=$3 last;
rewrite ^/comment-([0-9]+)-([0-9]+)-([0-9]+l /index.php?m=comment&c=index&a=init&commentid=content_$1-$2-$3 last;
rewrite ^/([^.]*l /index.php?m=member&c=index&a=$1 last;
}
更多信息請查看IT技術(shù)專欄