落伍者站长论坛's Archiver

超级后卫 发表于 2007-3-27 22:47

高手来帮我看一个zeus下wordpress的rewrite规则

wordpress放在根目录下面的blog文件夹

为什么我写了下面的规则,还是不可以静态化呢,高手帮忙了!:cool:


[quote]RULE_0_START:
# get the document root
map path into SCRATCH:DOCROOT from /blog/
# initialize our variables
set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}

# see if theres any queries in our URL
match URL into $ with ^(.*)\?(.*)$
if matched then
set SCRATCH:REQUEST_URI = $1
set SCRATCH:QUERY_STRING = $2
endif
RULE_0_END:

RULE_1_START:
# prepare to search for file, rewrite if its not found
set SCRATCH:REQUEST_FILENAME = %{SCRATCH:DOCROOT}
set SCRATCH:REQUEST_FILENAME . %{SCRATCH:REQUEST_URI}

# check to see if the file requested is an actual file or
# a directory with possibly an index. don't rewrite if so
look for file at %{SCRATCH:REQUEST_FILENAME}
if not exists then
look for dir at %{SCRATCH:REQUEST_FILENAME}
if not exists then
set URL = /blog/index.php?q=%{SCRATCH:REQUEST_URI}
goto QSA_RULE_START
endif
endif

# if we made it here then its a file or dir and no rewrite
goto END
RULE_1_END:

QSA_RULE_START:
# append the query string if there was one originally
# the same as [QSA,L] for apache
match SCRATCH:ORIG_URL into % with \?(.*)$
if matched then
set URL = %{URL}&%{SCRATCH:QUERY_STRING}
endif
goto END
QSA_RULE_END:[/quote]

飘叶 发表于 2007-3-28 00:15

:)

CSharp 发表于 2007-4-1 17:50

你需要实现什么样的效果,需要帮助加我QQ: 1624110

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.