Rewrite force lower-case of URI ?!

Oh, the strange things mod_rewrite does!

Rewrite force lower-case of URI ?!

Postby yelayon » Thu Nov 23, 2006 6:28 am

Hello

I have simple rule:
Code: Select all
RewriteEngine On
RewriteRule (.*) http://sap.incenti.pl:8001/$1 [P]

And log is:
Code: Select all
init rewrite engine with requested uri /sap(bD1wbCZjPTAwMSZkPW1pbg==)/bc/bsp/sap/hcm_learning/leso.htm
pass through /sap(bD1wbCZjPTAwMSZkPW1pbg==)/bc/bsp/sap/hcm_learning/leso.htm
[per-dir c:/www/htdocs/sap/port8001/] add path-info postfix: c:/www/htdocs/sap/port8001/sap(bd1wbczjptawmszkpw1pbg==) -> c:/www/htdocs/sap/port8001/sap(bd1wbczjptawmszkpw1pbg==)/bc/bsp/sap/hcm_learning/leso.htm
[per-dir c:/www/htdocs/sap/port8001/] strip per-dir prefix: c:/www/htdocs/sap/port8001/sap(bd1wbczjptawmszkpw1pbg==)/bc/bsp/sap/hcm_learning/leso.htm -> sap(bd1wbczjptawmszkpw1pbg==)/bc/bsp/sap/hcm_learning/leso.htm
[per-dir c:/www/htdocs/sap/port8001/] applying pattern '(.*)' to uri 'sap(bd1wbczjptawmszkpw1pbg==)/bc/bsp/sap/hcm_learning/leso.htm'
[per-dir c:/www/htdocs/sap/port8001/] rewrite sap(bd1wbczjptawmszkpw1pbg==)/bc/bsp/sap/hcm_learning/leso.htm -> http://xxx.yyy.pl:8001/sap(bd1wbczjptawmszkpw1pbg==)/bc/bsp/sap/hcm_learning/leso.htm
[per-dir c:/www/htdocs/sap/port8001/] forcing proxy-throughput with http://xxx.yyy.pl:8001/sap(bd1wbczjptawmszkpw1pbg==)/bc/bsp/sap/hcm_learning/leso.htm
[per-dir c:/www/htdocs/sap/port8001/] go-ahead with proxy request proxy:http://xxx.yyy.pl:8001/sap(bd1wbczjptawmszkpw1pbg==)/bc/bsp/sap/hcm_learning/leso.htm [OK]


As U see rewrite is changing some part of URI to lowercase. Why?
When I will make ProxyPass / it works perfectly, but I will need some more complicated Rules for that reverse proxy and need to use RewriteRule and RewriteCond.

Rgds, W.
yelayon
 
Posts: 3
Joined: Thu Nov 23, 2006 6:20 am

Postby richardk » Thu Nov 23, 2006 10:28 am

Are you sure it's not just during processing?

You're using Windows right? Then it's because Windows is case insensitive, so everything is made lowercase for the comparing of paths (it's more complicated (will take longer) to compare multi case strings).
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby yelayon » Thu Nov 23, 2006 10:48 am

You can notice that lowercase convertion is in line:
Code: Select all
[per-dir c:/www/htdocs/sap/port8001/] add path-info postfix: c:/www/htdocs/sap/port8001/sap(bd1wbczjptawmszkpw1pbg==) -> c:/www/htdocs/sap/port8001/sap(bd1wbczjptawmszkpw1pbg==)/bc/bsp/sap/hcm_learning/leso.htm
But I don't why on Windows (which filesystem is case-insensitive) and on Linux one (which is case-sensitive) the same application (Apache + mod_rewrite) will work differently - for me this is insane.
I'll later check this feature on linux, but now I'm looking way to turn that feature off (that stupid add path-info postfix).

Rgds, W.
yelayon
 
Posts: 3
Joined: Thu Nov 23, 2006 6:20 am

Postby richardk » Thu Nov 23, 2006 11:20 am

Does it actually make a difference though? What problem is it causing?

I doubt you can stop it.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Idiosyncrasies

Who is online

Users browsing this forum: No registered users and 3 guests

cron