httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Stockhausen" <markus.stockhau...@collogia.de>
Subject Re: [users@httpd] mod_rewrite & mod_proxy & %2F in URL
Date Wed, 14 Jun 2006 18:59:15 GMT
Hello.

Thanks a lot for your tip but I think this will not help in our case.
I was not able to test if the switch works but your explanation
gives me the hint that it takes place in the mod_rewrite part
and not in the mod_proxy part. To bring it back into mind.
I guess the modules work this way:

step 1: mod_rewrite: .../... -> ...%2F...
step 2: mod_proxy: ...%2F... -> ...%252F...
step 3: mod_proxy: ...%252F... -> ...%2F...

This assumption is based on the rewrite log of apache:

192.168.10.96 - -
[07/Jun/2006:10:24:06 +0200]
[host.domain.de/sid#812ad30]
[rid#8229780/initial] (1) go-ahead with proxy request 
proxy:http://127.0.0.1:8100/Session/29-w7ljxma6GuREB5fEEyyZ/MessagePart/SPAM%2FDetected/23323-H.txt
[OK]
1

As you can see the %2F sequence is passed to mod_proxy
correctly. So I need the opportunity to switch of escaping
in mod_proxy.

Nevertheless I will try it the next days.

Best regards.

Markus Stockhausen

On Tue, 13 Jun 2006 14:33:49 +0200
  Axel-St├ęphane  SMORGRAV <Axel-Stephane.SMORGRAV@europe.adp.com> wrote:
> I thought there was a flag blocking URL escaping in rewrite rules, but I am actually
unable to find it in the module 
>documentation. Checking the code, however, I found the following:
> 
> bash-2.03$ grep -n NOESCAPE mod_rewrite.h
> 125:#define RULEFLAG_NOESCAPE           1<<13
> 128:#define ACTION_NOESCAPE             1<<1
> bash-2.03$ 
> 
> from mod_rewrite.c
> 
>    else if (   strcasecmp(key, "noescape") == 0
>        || strcasecmp(key, "NE") == 0       ) {
>        cfg->flags |= RULEFLAG_NOESCAPE;
>    }
> 
> Could you try adding the NE flag to your rewrite rule and see what happens ?? 
> 
> -ascs
> 
> -----Original Message-----
>From: Markus Stockhausen [mailto:markus.stockhausen@collogia.de] 
> Sent: Tuesday, June 13, 2006 5:57 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] mod_rewrite & mod_proxy & %2F in URL
> 
> Hello.
> 
> We used Apache 2.0.54 as a reverse proxy for an internet webmail access with the following
rewrite rule:
> 
> AllowEncodedSlashes On
> RewriteEngine on
> RewriteRule
>   /(.*)/MessagePart/(.*)/(.*)/(.*)-H.txt
>   http://127.0.0.1:8100/$1/MessagePart/$2\%2F$3/$4-H.txt [P]
> 
> It is essential for the mailserver to get the %2F character instead of an /.
> Otherwise the request results in an "404 not found error". The ruleset worked well until
we upgraded to 2.0.58. Suddenly the 
>rewrite produced another URL string. What before was an %2F now results in an %252F.
> 
> We could track down that problem to the following patch that came with version
> 2.0.55: http://svn.apache.org/viewvc?view=rev&revision=227435
> 
> Obviously the old (but for us correct) url translation worked in three steps:
> step 1: mod_rewrite: .../... -> ...%2F...
> step 2: mod_proxy: ...%2F... -> ...%252F...
> step 3: mod_proxy: ...%252F... -> ...%2F...
> 
> With the patch step 3 is now obsolete and we have no possibility to encode an / character
into an %2F because mod_proxy will 
>always replace any % charachter it finds with the %25 chars.
> 
> Has anyone an idea of how to come around this problem. The only solution we found was
to disable the patch and to force the 
>behaviour as it was before.
> 
> Best regards.
> 
> Markus Stockhausen
> 
> ---------------------------------------------------------------------
> 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
> 


---------------------------------------------------------------------
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