首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Zeus rewrite.script -多个目录

Zeus rewrite.script -多个目录
EN

Stack Overflow用户
提问于 2012-04-25 23:46:41
回答 1查看 315关注 0票数 1

为多个目录寻找Zeus的一些帮助我有一个工作脚本,它在我将Wordpress放在一个子目录中-然而,如果我想在另一个目录中运行另一个Wordpress安装,我也无法让重写与此一起工作。任何帮助都将不胜感激!

我对1个目录的重写

代码语言:javascript
复制
#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上也这样做呢?

谢谢

EN

回答 1

Stack Overflow用户

发布于 2012-12-14 19:04:43

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

文件的其余部分重定向到www形式的网站的.com版本(rule2),而不是www形式的网站(rule1)。

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

代码语言:javascript
复制
#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:
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10319104

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档