分享之 Discuz! 的 RewriteRule for Cherokee 

把论坛架在Cherokee上,地址伪静态用的还是apache的,一点一个404……囧rz

现把我设好的重写规则,张贴如下(当然,你也可以自己到控制台设置,也不难)

适用于 一个documentRoot 为 /data/www/web/bbs 的discuz! 7.2 论坛:

vserver!30!document_root = /data/www/web/bbs
vserver!30!error_writer!filename = /usr/local/cherokee/var/log/cherokee.error
vserver!30!error_writer!type = file
vserver!30!keepalive = 1
vserver!30!logger = combined
vserver!30!logger!access!filename = /usr/local/cherokee/var/log/cherokee.access
vserver!30!logger!access!type = file
vserver!30!logger!x_real_ip_access_all = 0
vserver!30!logger!x_real_ip_enabled = 0
vserver!30!match = wildcard
vserver!30!match!domain!1 = bbs.xiazhengxin.*
vserver!30!nick = BBS
vserver!30!rule!1000!handler = redir
vserver!30!rule!1000!handler!rewrite!1!regex = ^/tag-(.+)\.html$
vserver!30!rule!1000!handler!rewrite!1!show = 0
vserver!30!rule!1000!handler!rewrite!1!substring = /tag.php?name=$1
vserver!30!rule!1000!match = request
vserver!30!rule!1000!match!request = ^/tag-(.+)\.html$
vserver!30!rule!1000!no_log = 0
vserver!30!rule!1000!only_secure = 0
vserver!30!rule!900!handler = redir
vserver!30!rule!900!handler!rewrite!1!regex = ^/space-(username|uid)-(.+)\.html$
vserver!30!rule!900!handler!rewrite!1!show = 0
vserver!30!rule!900!handler!rewrite!1!substring = /space.php?$1=$2
vserver!30!rule!900!match = request
vserver!30!rule!900!match!request = ^/space-(username|uid)-(.+)\.html$
vserver!30!rule!900!no_log = 0
vserver!30!rule!900!only_secure = 0
vserver!30!rule!800!handler = redir
vserver!30!rule!800!handler!rewrite!1!regex = ^/archiver/((fid|tid)-[\w\-]+\.html)$
vserver!30!rule!800!handler!rewrite!1!show = 0
vserver!30!rule!800!handler!rewrite!1!substring = /archiver/index.php?$1
vserver!30!rule!800!match = request
vserver!30!rule!800!match!request = ^/archiver/((fid|tid)-[\w\-]+\.html)$
vserver!30!rule!800!no_log = 0
vserver!30!rule!800!only_secure = 0
vserver!30!rule!700!handler = redir
vserver!30!rule!700!handler!rewrite!1!regex = ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$
vserver!30!rule!700!handler!rewrite!1!show = 0
vserver!30!rule!700!handler!rewrite!1!substring = /viewthread.php?tid=$1&extra=page\=$3&page=$2
vserver!30!rule!700!match = request
vserver!30!rule!700!match!request = ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$
vserver!30!rule!700!no_log = 0
vserver!30!rule!700!only_secure = 0
vserver!30!rule!600!handler = redir
vserver!30!rule!600!handler!rewrite!1!regex = ^/forum-([0-9]+)-([0-9]+)\.html$
vserver!30!rule!600!handler!rewrite!1!show = 0
vserver!30!rule!600!handler!rewrite!1!substring = /forumdisplay.php?fid=$1&page=$2
vserver!30!rule!600!match = request
vserver!30!rule!600!match!request = ^/forum-([0-9]+)-([0-9]+)\.html$
vserver!30!rule!600!no_log = 0
vserver!30!rule!600!only_secure = 0
vserver!30!rule!500!disabled = 0
vserver!30!rule!500!encoder!gzip = 1
vserver!30!rule!500!handler = fcgi
vserver!30!rule!500!handler!balancer = round_robin
vserver!30!rule!500!handler!balancer!source!1 = 1
vserver!30!rule!500!handler!error_handler = 1
vserver!30!rule!500!match = extensions
vserver!30!rule!500!match!extensions = php
vserver!30!rule!500!match!final = 1
vserver!30!rule!500!timeout = 30
vserver!30!rule!400!disabled = 0

_____________

把代码粘贴入cherokee.conf 相对位置即可.
[ 5 评论 ] ( 755 次浏览 ) 永久链接 ( 3 / 1363 )

<< <上一页 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 下一页> >>