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
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
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