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: [EMAIL PROTECTED]

   "   from the digest: [EMAIL PROTECTED]

For additional commands, e-mail: [EMAIL PROTECTED]

 

 

Reply via email to