Forum Moderators: phranque
What is the syntax like when I want mod_rewrite to apply the "unescape" command to translate the hex-encoded "%20" back to " "? I tried
RewriteRule ^/(.*)\.html$ /cgi?var=${rewritemap:$1 [L,unescape] but thats like the standard behavior.
Thanks a lotMaggy
I've never tried anything like this, but I do note that the closing "}" around RewriteMap is missing in both of your examples. That may cause some of these problems.
As an alternative, would it be possible to alter your script to substitute "-" for " " when it outputs a URL? This would simplify the whole problem.
Jim
I am wondering about the syntax I found in:
[httpd.apache.org...]
RewriteMap lowercase int:tolower
RewriteMap vhost txt:/path/to/vhost.map
RewriteRule ^/(.*)$ %1/$1 [E=VHOST:${lowercase:%{HTTP_HOST}}]
I am familar in using txt:/path/to/map
but do I have to define the function "Rewritemap int:unescape" with
RewriteMap myunescape int:unescape
as an internal dummy definition (without a path as in
RewriteMap mylistfile txt:/path) and to use later on "myunescape" in the RewriteRule?
I found another example with an internal function:
[simon.incutio.com...]
RewriteEngine on
RewriteMap lowercase int:tolower
RewriteCond ${lowercase:%{SERVER_NAME}} ^([a-z-]+)\.staging\.mintchaos\.com$
RewriteRule ^(.*) /home/mintch/www/staging/%1/$1
And tried:
RewriteMap myunescape int:unescape
RewriteRule ^/(.*)\.html$ /cgi?var=${{myunescape}mylistfile:$1} [L]
The syntaxcheck is ok, but it is not working.
Thanks, Maggy