1

为多个目录寻找 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?

谢谢

4

1 回答 1

0

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

文件的其余部分以 www 形式(规则 2)和不带 www(规则 1)的形式重定向到 .com 版本的网站。

将文件保存为 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:
于 2012-12-14T11:04:43.027 回答