Zeus rewrite.script - 多个目录

时间:2012-04-25 15:46:41

标签: rewrite wordpress zeus

为多个目录寻找Zeus Rewrite.Script的一些帮助 - 我有一个工作脚本,我将WordPress放在子目录中运行 - 但是,如果我想在另一个目录中运行另一个Wordpress,我可以'得到重写也适用于此。任何帮助将不胜感激!

我重写1个目录; -

#Zeus webserver version of basic Wordpress mod_rewrite rules
map path into SCRATCH:path from %{URL}
look for file at %{SCRATCH:path}
if exists then goto END
look for dir at %{SCRATCH:path}
if exists then goto END
##### FIX FOR LOGIN/FORGOTTEN PASSWORD/ADMIN ETC #####
match URL into $ with ^/site1/wp-.*$
if matched then goto END
##### FIX TO ALLOW SEARCH TO WORK #####
match URL into $ with ^/oxford-walking-tours/(.*)
set URL = /site1/index.php/$1

所以第一个目录中的site1 - 有人可以建议我如何为site2做这个工作吗?

由于

1 个答案:

答案 0 :(得分:0)

以下脚本可以帮助所有ZEUS服务器重定向 它会忽略名为myfolder的文件夹(将其替换为您要从任何重定向中排除的文件夹,您仍然可以访问它。)

文件的其余部分以www格式(规则2)重定向到网站的.com版本,没有www(rule1)。

将文件另存为rewrite.script并上传到服务器的根目录。

#ignore anything to do with myfolder
match URL into $ with ^/myfolder(\/)?.*
if matched then goto END


RULE_1_START:
match IN:Host into $ with ^mywebsite\.net$             
if matched then            
match URL into $ with ^/(.*)$             
if matched then            
set OUT:Location  = http://www.mywebsite.com/$1             
set OUT:Content-Type = text/html             
set RESPONSE = 301             
set BODY = Moved             
endif             
endif
RULE_1_END:

RULE_2_START:
match IN:Host into $ with ^www.\mywebsite\.net$             
if matched then            
match URL into $ with ^/(.*)$             
if matched then            
set OUT:Location  = http://www.mywebsite.com/$1             
set OUT:Content-Type = text/html             
set RESPONSE = 301             
set BODY = Moved             
 endif       
endif
RULE_2_END: