宙斯重写规则 [英] Zeus Rewrite Rules

查看:140
本文介绍了宙斯重写规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个呈现URL的网站:

/work.php?cat=identity

通常,我会研究如何使用mod_rewrite,但是不幸的是,我的托管服务器(Namesco)使用Zeus而不是Apache,这很奇怪.我将如何使用Zeus的重写规则将其转换为:

/work/identity

这是一个更干净,更好的SEO友好版本.最重要的是,我仍然需要$ _GET变量处于活动状态,因为它从数据库请求有关变量cat的信息.

我之前从未重写过URL,所以我不知道从哪里开始.我已经尝试过使用这个rewrite.script文件进行更改,该文件保存在我的网络文件夹中

match URL into $ with ^/work.php?cat=/(.*)
if matched set URL= /work/$

不幸的是,它不起作用.任何人都可以提供帮助或提供其他选择吗?

解决方案

对此进行了快速操作,我相信我已经向自己证明了请求重写无法操纵URL的查询元素.

有一个潜在的解决方案,但它变得更加丑陋!

您可以使用ZWS的"Perl扩展"来实现.本质上,您将请求传递给ZWS内的Perl引擎,对它运行脚本,然后将结果传递回ZWS.

但是,恐怕这超出了我的能力范围!我是宙斯交通管理器"的一章……

尼克

I have a website that renders the URL:

/work.php?cat=identity

Normally I would research how to use mod_rewrite but unfortunately my hosting (Namesco) uses Zeus and not Apache, which is strange. How would I use Zeus' rewrite rules to convert to:

/work/identity

This is a much cleaner, nicer SEO friendly version. On top of this, I still need the $_GET variable to be active because it requests information about the variable cat from the database.

I've never rewritten URLs before so I've no idea where to begin. I've attempted the change with this rewrite.script file which is saved within my web folder

match URL into $ with ^/work.php?cat=/(.*)
if matched set URL= /work/$

Unfortunately it doesn't work. Can anyone help or perhaps offer an alternative?

解决方案

had a quick play with this, and I believe I have proven to myself that the Request Rewriting is not able to manipulate the query element of the URL.

There is a potential solution, but it gets even more ugly!

You could use the "Perl Extensions" of ZWS to achieve this. Essentially you pass the request to the Perl engine within ZWS run a script against it, then pass the result back to the ZWS.

I am afraid this is a bit beyond my capabilities however! I am a "Zeus Traffic Manager" sort of chap...

Nick

这篇关于宙斯重写规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆