httpd-users mailing list archives

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

Hi,

 

 

I need a case insensitive url rewrite such as

 

      http://proxyhost/NeWs

 

would be rewritten to:

 

      http://realserver/some/other/url

 

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 txt:somemap.map

RewriteMap toupper int:toupper

 

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

 

 

This nested mapping did not seem to work with mod_rewrite!

 

So I tried the next:

 

RewriteMap somemap txt:somemap.map

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,

 

 

 

 

Charles

 

 

---------------------------------------------------------------------

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

See <URL:http://httpd.apache.org/userslist.html> for more info.

To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org

   "   from the digest: users-digest-unsubscribe@httpd.apache.org

For additional commands, e-mail: users-help@httpd.apache.org

 

 


Mime
View raw message