httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Köhler <>
Subject [users@httpd] How to properly build querystring in RewriteRule
Date Sat, 28 Jun 2008 19:42:28 GMT

so i'd like to do the following:

If a Browser sends a request to "" then i'd 
like to redirect the browser to

If course, if anyname is substituted by ??? or &&& or ===, i still want 
things to work properly - that is:
   chars like ?&= must be replaced by  % following two hex digits.

Here's what i've tried so far:

RewriteEngine On
RewriteMap mymap int:escape

1) RewriteRule ^/test{HTTP_HOST} [L,R=301]

2) RewriteRule ^/test${mymap:%{HTTP_HOST}} [L,R=301]

So the escape-map used in 2) sucks. It doesn't escape & or = or ?
The rule 1) simply redirects to URLs such as

URLs which i simply consider very harmful.

What's the apache-way of properly doing this?
I don't want to have an external program for doing the mapping. This is 
such a standard-task (building a properly escaped querystring) - there 
must be way.

I'm using apache 2.2.9 on Linux.


View raw message