Forum Moderators: phranque
We have a RewriteMap configured and working fine, however we need to add a URL to the map that contains a space. I have tried several different things, but none of them work. What I have in the map file is:
trains.shtml/title/Trains Outbound/section/General trains/outbound
Obviously it can't be a space as the space is the field delimiter, I have tried replacing the space with %20 and . (dot) and adding a \ before the space but none of them worked.
The rewrite conditions and rules are:
RewriteMap theMap txt:/tmp/theMap.txt
RewriteCond ${theMap:$1¦NotFound}!NotFound
RewriteRule ^/(.*) ${theMap:$1} [R=301,L]
How do you escape a space in the map file?
Thanks in advance for any help.
Kind regards,
Andrew
I would change the space in the URL itself to be a hyphen or a dot or a comma (but NOT an underscore).
As you know, a space gets encoded as %20 - otherwise how could you tell where the end of a URL was?
URLs with spaces in them soon%20become%20very%20hard%20to%20read.