Zeus Rewrite Rules

一个人想着一个人 提交于 2019-12-25 02:24:42

问题


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?


回答1:


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




回答2:


Zeus Rewrite Rules are able to access the query part of a URL string. The key thing your missing it looks like is the 1 following the $ on the output URL and the slash should be removed:

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

should be

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



回答3:


I am wondering if the rewrite rules are available for the query portion of the URI? The docs do seem to only speak about the path element.

http://support.zeus.com/zws/docs/2005/12/16/zeus_web_server_4_3_documentation

page 141 seems to be the start of it...

I will attempt to fire up a ZWS VM and test this myself.

Nick



来源:https://stackoverflow.com/questions/5390611/zeus-rewrite-rules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!