mod_rewrite
The ability to redirect, set environment variables, apply access controls
and perform other data transformations that mod_rewrite provides
allows us to put logic in the server that we otherwise would be forced to
perform with a CGI or a one-off home grown module.
Here is an example of using mod_rewrite to provide QUERY_STRING based
navigation without the use of an external program (i.e. a CGI, etc).
In httpd.conf we add the following directives:
RewriteEngine On
RewriteMap unescape-chars int:unescape
RewriteCond %{QUERY_STRING} location=(.*)
RewriteRule ^/locations.* ${unescape-chars:%1}? [L,R]
Using mod_rewrite's unescape function we can filter
data through Apache's native URL escaping facility so hex-escaped data
comes out transformed in the clear. So let's look at some HTML we could have
make use of this.