httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Charles" <>
Subject [users@httpd] RE: case insensitive rewrite rules and nested mapping
Date Mon, 04 Sep 2006 20:05:09 GMT




I need a case insensitive url rewrite such as




would be rewritten to:




here, "/NeWs" first mapped to all upper case "NEWS" and then used to
lookup another map in which I have a line like this:



# my text map file

NEWS  /some/other/url



My first thought was to use the internal mapper "toupper" together with
my own mapper so the rules would look like the following:



RewriteMap somemap

RewriteMap toupper int:toupper


RewriteRule ^/(NEWS)$ http://realserver/${somemap:${toupper:$1}}



This nested mapping did not seem to work with mod_rewrite!


So I tried the next:


RewriteMap somemap

RewriteMap toupper int:toupper


RewriteRule ^/(NEWS)$ http://%{REQUEST_HOST}/${toupper:$1}  [NC,R,L]

RewriteRule ^/(NEWS)$ http://realserver/${somemap:$1}  [P,L]




This actually worked but I am not happy with it as it forced a redirect
and therefore the URL in the user's browser is changed.



Anybody has a better solution that would avoid a redirect?



Many thanks and best regards,









The official User-To-User support forum of the Apache HTTP Server

See <URL:> for more info.

To unsubscribe, e-mail:

   "   from the digest:

For additional commands, e-mail:



View raw message