如何在Zeus Web Server中使用Mambo的SEO功能

发布: 2006-7-16 00:00 | 作者: Allan | 来源: 《深圳赛佛莱特科技有限公司》技术版

众所周知,Mambo如果用在IIS和APACHE环境中是很好解决的,网上有很多现成的Rewrite规则,但是如何在Zeus中使用是很多朋友关心的问题了,站长也碰到了该问题,在网上一直没找到现成可用的重写规则,哪怕是在mambo官方网站也无人解答这个问题。今天突然觉得有必要解决这个问题,于是研究了一下,发现其实并不难,稍稍了解一下Zeus的重写规则样本,然后将没有使用SEO之前的真实联接与使用SEO之后的联接对比一下,这个重写规则基本上就出来了。

以下是站长的Zeus URL重写规则,需要的朋友可以参考一下,写得并不高明,不过还是解决了问题。

CODE:

//这里是返回首页的重写规则
match URL into $ with ^/mos/Frontpage/
if matched then
   set URL = /index.php?option=com_frontpage&Itemid=1
endif

//查看分类列表的重写规则
match URL into $ with ^/content/category/?([0-9]{1,})/?([0-9]{1,})/?([0-9]{1,})/
if matched then
   set URL = /index.php?option=com_content&task=category&sectionid=$1&id=$2&Itemid=$3
endif

//这里是查看文章内容的重写规则
match URL into $ with ^/content/view/?([0-9]{1,})/?([0-9]{1,})/
if matched then
   set URL = /index.php?option=com_content&task=view&id=$1&Itemid=$2
endif

//这里是列表section的重写规则
match URL into $ with ^/content/section/?([0-9]{1,})/?([0-9]{1,})/
if matched then
   set URL = /index.php?option=com_content&task=section&id=$1&Itemid=$2
endif

//这里是处理Remository下载组件中验证的规则
match URL into $ with ^/component/option,com_remository/func,download/id,?([0-9]{1,})/chk,(.*)/
if matched then     
   set URL = /index.php?option=com_remository&Itemid=20&func=download&id=$1&chk=$2
endif

//这里是处理Remository下载组件中选择目录及查看文件信息的重写规则
match URL into $ with ^/component/option,com_remository/func,(.*)/id,?([0-9]{1,})/
if matched then     
   set URL = /index.php?option=com_remository&Itemid=20&func=$1&id=$2
endif

//这里返回Remository根目录,这里要放在最后面,否则会出现问题。
match URL into $ with ^/component/option,com_remository/
if matched then     
   set URL = /index.php?option=com_remository&Itemid=20
endif
先在Mambo的全局配置里开启SEO功能,然后在Zeus的Request Rewriting中加入重写规则然后应用,就可以了。当然,每个站点的模块跟我的可能不一样,那么规则也得根据情况来定,但参考以上重写规则,我相信基本上都可以解决。

如果用户有什么疑问可以在本贴内留言。

演示地址:http://www.safenet.net.cn

2006.07.16 《超级中国》中文站原创。转载请保留本信息。